hi, can anyone tell me how you do optionals {:parameters {:query {:param1 pos-int?}}}
been searching the docs but struggling to find an example, I am using swagger-ui and spec, i have defined all my params but if i submit from swagger with no values they all fail
{:parameters {:query {(ds/opt :param1) pos-int?}}}
I was trying something like (s/or :int pos-int? :blank nil?) but that failed
(require '[spec-tools.data-spec :as ds])
that is.oh cheers, thanks for that will go look up ds/opt
okay great will give it a try 🙂
or you can just use normal spec:
{:parameters {:query (s/keys :opt-un [::params1])}}
I was trying something like that, but struggled with namespacing
basically ended up creating :request/type and :response/type to avoid conflicts
but then the api picks up the request part of the spec which i don't want
mainly because I am trying to maintain compatibility with an older api
if I used just ::type it would not work because the request and response values differ
looking at it data-specs may solve this any way
anyway the data spec thing worked a treat @ikitommi thanks again 🙂