mirror of
https://github.com/metosin/reitit.git
synced 2025-12-17 00:11:11 +00:00
Use latest malli fixing visitors
This commit is contained in:
parent
f624dc34d9
commit
b651fac0b0
4 changed files with 19 additions and 9 deletions
|
|
@ -15,7 +15,8 @@
|
|||
; [spec-tools.spell :as spell]
|
||||
[ring.adapter.jetty :as jetty]
|
||||
[muuntaja.core :as m]
|
||||
[clojure.java.io :as io]))
|
||||
[clojure.java.io :as io]
|
||||
[malli.util :as mu]))
|
||||
|
||||
(def app
|
||||
(ring/ring-handler
|
||||
|
|
@ -70,7 +71,16 @@
|
|||
;;:reitit.spec/wrap spell/closed ;; strict top-level validation
|
||||
:exception pretty/exception
|
||||
:data {:coercion (reitit.coercion.malli/create
|
||||
{:error-keys #{#_:type :coercion :in :humanized :schema :value #_:transformed #_:errors}})
|
||||
{;; set of keys to include in error messages
|
||||
:error-keys #{#_:type :coercion :in :schema :value :errors :humanized #_:transformed}
|
||||
;; schema identity function (default: close all map schemas)
|
||||
:compile mu/closed-schema
|
||||
;; strip-extra-keys (effects only predefined transformers)
|
||||
:strip-extra-keys true
|
||||
;; add/set default values
|
||||
:default-values true
|
||||
;; malli options
|
||||
:options nil})
|
||||
:muuntaja m/instance
|
||||
:middleware [;; swagger feature
|
||||
swagger/swagger-feature
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
#?(:clj
|
||||
(defmethod print-method ::coercion [coercion ^Writer w]
|
||||
(.write w (str "<<" (-get-name coercion) ">>"))))
|
||||
(.write w (str "#Coercion{:name " (-get-name coercion) "}"))))
|
||||
|
||||
(defrecord CoercionError [])
|
||||
|
||||
|
|
@ -137,7 +137,7 @@
|
|||
;; api-docs
|
||||
;;
|
||||
|
||||
(defn get-apidocs [this specification data]
|
||||
(defn get-apidocs [coercion specification data]
|
||||
(let [swagger-parameter {:query :query
|
||||
:body :body
|
||||
:form :formData
|
||||
|
|
@ -153,7 +153,7 @@
|
|||
(map (fn [[k v]] [(swagger-parameter k) v]))
|
||||
(filter first)
|
||||
(into {}))))
|
||||
(-get-apidocs this specification)))))
|
||||
(-get-apidocs coercion specification)))))
|
||||
|
||||
;;
|
||||
;; integration
|
||||
|
|
|
|||
|
|
@ -109,11 +109,11 @@
|
|||
:response {:default default-transformer-provider}}
|
||||
;; set of keys to include in error messages
|
||||
:error-keys #{:type :coercion :in :schema :value :errors :humanized #_:transformed}
|
||||
;; schema identity function
|
||||
;; schema identity function (default: close all map schemas)
|
||||
:compile mu/closed-schema
|
||||
;; strip-extra-keys (effects only default transformers!)
|
||||
;; strip-extra-keys (effects only predefined transformers)
|
||||
:strip-extra-keys true
|
||||
;; add default values
|
||||
;; add/set default values
|
||||
:default-values true
|
||||
;; malli options
|
||||
:options nil})
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
[metosin/muuntaja "0.6.5"]
|
||||
[metosin/jsonista "0.2.5"]
|
||||
[metosin/sieppari "0.0.0-alpha7"]
|
||||
[metosin/malli "0.0.1-20200106.232607-10"]
|
||||
[metosin/malli "0.0.1-20200108.194558-11"]
|
||||
|
||||
[meta-merge "1.0.0"]
|
||||
[fipp "0.6.21" :exclusions [org.clojure/core.rrb-vector]]
|
||||
|
|
|
|||
Loading…
Reference in a new issue