Thanks for the development of this gem, it saved me a lot of time!
Since I would like to follow the JSON API conventions as much as possible, I'm wondering how I can switch the content-type completely to "application/vnd.api+json".
Doing this for the responses, I'm using:
before do
content_type("application/vnd.api+json")
end
But I didn't found any proper way of setting it for the incoming requests. If clients are using this content-type, they are getting block with "The requested content-type 'application/vnd.api+json' is not supported.".
Looking into grape itself, I found that support was initially added and later removed because if wasn't fully supported, I think the error response was not rendered correctly.
Now I'm wondering if the roar-jsonapi gem is offering any help in this? Is there any formater, I could use to define my own jsonapi content-type with something like this:
content_type :jsonapi, "application/vnd.api+json"
formatter :jsonapi, -> (object, _env) { Oj.dump(object) }
Because this example generates a "stack level" to deep, when rendering the response, but works with accepting the request.
I would really appreciate any help.
My current implementation looks like
This works, because I'm using roar-jsonapi, but I'm wondering if there is a better alternative.