ring-swagger 2020-02-08

this gave me the hunch that the following should work - and it does!

(def user-ids-spec
  (st/spec
    {:spec (s/coll-of ::corespec/user-id)
     :description "comma separated list of user-ids"
     :json-schema/type {:type "string"}
     :json-schema/example "1,2,3"
     :decode/string #(cs/split %2 #",")
     :encode/string #(cs/join %2 ",")}))
(context "/v1" []
    :coercion :spec
    (GET "/events" []
      :coercion :spec
      :query-params [user-ids :- user-ids-spec]
      (println "foo" (pr-str {} user-ids 30)))))
i.e. instead of registering result of st/spec with s/def i am just referencing it in the :query-params specification

Let me know if you want me to open an issue or update the docs somewhere.

what is different with that code? looks the same as the original?

oh, the s/def… sounds like a bug to me.

but glad you got it working!

should i open a PR for a change in -map-spec?

sure, please do

@mx06409 has joined the channel