Closed solussd closed 11 years ago
Currently there is no way to use a custom (json) encoder with noir.response/json. Using cheshire.custom/generate-string (instead of cheshire.core/generate-string) lets me add custom encoders for unsupported types, e.g.:
(cheshire.custom/add-encoder org.bson.types.ObjectId (fn [o json-generator] (.writeString json-generator (str o)))) (cheshire.custom/generate-string (org.bson.types.ObjectId.)) ; => "\"4ff3648fc2e6638a4552a80b\""
This was done a while ago.
Excellent, thanks.
Currently there is no way to use a custom (json) encoder with noir.response/json. Using cheshire.custom/generate-string (instead of cheshire.core/generate-string) lets me add custom encoders for unsupported types, e.g.: