Hi, @ikitommi I was implementing a handler to process a type decimal
and it returned an error saying that could not coerce the value. I remember that I sent a PR to help with this issue in spec-tools
however, when I was looking at my toy-example, it used {:parameters {:form ::decimal-var?}}
and now this new code is using {:parameters {:body ::decimal-vars?}}
when I changed to :form
it worked just fine! Could you point to where I can trace down the differences between :form
and :body
in reitit coercion?
I need anything special to swagger enable the input box for path-parameters?
(s/def ::produto spt/string?)
(def product-routes
["/product/:produto" {:get {:summary "what is your configuration?"
:parameters {:path-params (s/keys :req-un [::produto])}
:handler (fn [req]
(println req)
{:status 200
:body "ok"})}}])
this is my current handler@iagwanderson it should be {:parameters {:path …}}
. I recommned enabling the spec & spell checking on, it will warn about invalid keys at router creation time.
https://github.com/metosin/reitit/blob/master/modules/reitit-core/src/reitit/coercion.cljc#L39-L40ere’s the differentiator: https://github.com/metosin/reitit/blob/master/modules/reitit-core/src/reitit/coercion.cljc#L39-L40
e.g. form is always converterd from strings, body from the json, edn etc, which might have a different transformer used.