1. 首页
  2. 考试认证
  3. 其它
  4. schema compojure组合与方案的强大函数

schema compojure组合与方案的强大函数

上传者: 2024-10-31 15:36:06上传 ZIP文件 9.13KB 热度 3次

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\" \"\")

下载地址
用户评论