Hello all does anyone have any idea where I should be passing the collection-format : "csv"
option in order to parse query parameters values in a comma separated list? Looking through the source code, it looks like in schema-tools.swagger.core
on line 51, the default option is multi
, but I can't seem to find the right spot to overide that default. The default behavior on reitit swagger is to send multiple values of the same query parameters as duplicate query parameters, i.e ?id=1&id=2
. I'd like to support the structure ?id=1,2
Hmm, in Compojure-api/Ring-swagger this was using describe/field function, but it is a bit different here.
Doesn't seem to be documented. Impl is here: https://github.com/metosin/schema-tools/blob/master/src/schema_tools/swagger/core.cljc#L160-L164 Keys with :swagger ns from the additional data are merged to the properties swagger spec.
Hello! I am using muuntaja with reitit for response formatting (`format-response-middleware`) and I’d like to know if there is a way to configure the underlying object mapper to not write json properties with null value. Jackson’s object mapper supports it and I saw that jsonista uses Jackson’s OM, but I didn’t find a way to set this option (i.e. ObjectMapper.disable(SerializationFeature/WRITE_NULL_MAP_VALUES
).
I do something a bit different (not saying it's better, just that I approached this from a different angle). I use specter to strip out any nil's from my maps before I send them out
(:require
[com.rpl.specter :refer [declarepath providepath if-path compact setval MAP-VALS NONE STAY]]))
(set! *warn-on-reflection* true)
(declare DEEP-MAP-VALS)
(declarepath DEEP-MAP-VALS)
(providepath DEEP-MAP-VALS (if-path map? [(compact MAP-VALS) DEEP-MAP-VALS] STAY))
(defn clean
[data]
(setval [DEEP-MAP-VALS nil?] NONE data))
So I would call (clean my-data-structure)
just before passing it back out
@matheus.emm if you're interested, I've put together a working example here: https://github.com/dharrigan/strip-nils
Cool, thanks!
This provides serialisation features to Jackson, to strip out the nils, with examples