Closed tzzh closed 5 years ago
I ended up using empty string default value and then filtering empty strings in the handler
You can do:
:query {(s/optional-key :current-status) CurrentStatus}
or
:query-params [{current-status :- CurrentStatus :default-current-status-value}]
Library Version(s)
1.1.11
Problem
Is it possible to use optional query-params with the inline syntax ?
I can get it to work with resource
but that then breaks the swagger interface (I believe because of some custom middleware), and that's a frequent use case so I am wondering if there is a way to do it with the inline syntax ? This https://github.com/metosin/compojure-api/issues/154 suggests the hack of setting default values and then having a custom coercer but I was wondering if there was a better way to do it.