How to parse JSON request with custom Content-Type
It's great to be able to parse a JSON request just by doing context.parse(MyBean.class) but apparently that only works if the request content type is application/json.
In my current project we use custom content types of the application/vnd.mycompany.mytype+json variety, and in that case Ratpack returns a 500 error saying NoSuchParserException: Could not find parser...
Is there any way to configure how to parse custom content types?
For the time being we had to resort to using the Jackson ObjectMapper directly.
Re: How to parse JSON request with custom Content-Type
Unfortunately looks like JsonParser is not really configurable at the moment. It also lives in an internal namespaced package (ratpack.jackson.internal) so you probably shouldn't depending on that class to be there in whatever your solution is if you want to not have to change it when upgrading Ratpack version.
The safest solution that comes to my mind is creating your own parser by extending ratpack.parse.ParserSupport, coping and pasting the implementation of JsonParser, changing this condition and adding your new parser to the registry.