schema compojure组合与方案的强大函数
ru.prepor/schema-compojure是一个基于Prismatic的库,主要用于与验证和强制集成。使用示例:
(require '[ru.prepor.schema-compojure :refer [defroutes context GET]])
(defroutes app {
:matcher coerce/string-coercion-matcher
(context \"/admin\" []
(context \"/users/:id\" [[ :params id :- s/Int]]
(GET \"/\" [] (format \"Hello, %s\" (inc id)))))
(GET \"/\" [] \"Hello world!\"))
(prn \"Result\" \"\")
下载地址
用户评论