Closed daviddpark closed 10 years ago
That sounds fine. There's also a application/schema+json
that isn't covered by that regex. It could do with improving.
Would this be too greedy for your tastes, Jim?
#"^application/(.+\+)?json"
I was thinking along similar lines. I can't think of any place where that wouldn't work. Certainly all of the official media types fit into that pattern.
Thanks for your consideration of the pull request, Jim!
A recent change for #16 will now only provide the data in :json-params and :params when the JSON submitted with a request is an object.
I am working on a clojure implementation for JSON patch: and the specification states:
Of course, the media type is currently incompatible with the current regular expression for ring-json:
To that end, there are a number of JSON media types proposed to the IANA that are not compatible with that particular regular expression.
I would be happy to submit a pull request for a modified regular expression if that would be well-received.
I also would like to discuss a slight modification of the code introduced for #16 that will only merge maps into request :params, but will enable arrays to be passed through to :json-params, or perhaps introduce :json-body or :json-array for when the incoming JSON is not an object.
Thoughts?