Open wagenet opened 3 years ago
Also, is there any reason why we shouldn't just use the same behavior as the built-in json handler?
I think this is so users can pass in a normal application/json
instead of application/vnd.api+json
and still get JSON:API rendered. Originally because it's a hurdle to get up and running quickly for new users, at this point it's more for backwards-compatibility.
If you can accomodate that use case and everything still seems to be working correctly I'm 👍
I changed it and no tests failed, so not sure.
Yeah I am just not sure. That block was originally copied from jsonapi-rb
I know, but I think I added the format
part.
I'm mentally 👍 but just kinda scared :/
Setting the
format
in parameters has a special behavior in Rails. One side effect isrespond_to
will now ignore any provided Accept header in favor of the provided format. The default Rails json parser doesn't set format and it doesn't seem to me that we need to set it either.https://github.com/graphiti-api/graphiti-rails/blob/c557ca44b5b9930c2c7023e4d7503dcba0fe8e56/lib/graphiti/rails/railtie.rb#L65