ngrunwald / ring-middleware-format

Ring middleware for parsing parameters and emitting responses in JSON or other formats
163 stars 49 forks source link

Content handler options not fully accessible #55

Closed nblumoe closed 5 years ago

nblumoe commented 8 years ago

It's not possible to pass all the options down to the handler of specific formats to override for example decoder or predicate. This is because they are contained in a nested :options hash-map being created here: https://github.com/ngrunwald/ring-middleware-format/blob/3fd37b99ffd0dc5202d0c92d0cdae0ce0c647766/src/ring/middleware/format_params.clj#L278 this does not override the top-level options via destructuring over here: https://github.com/ngrunwald/ring-middleware-format/blob/3fd37b99ffd0dc5202d0c92d0cdae0ce0c647766/src/ring/middleware/format_params.clj#L230

Thus, the calls like (or predicate transit-json-request?) will always end up with the second expression and cannot be overriden.