Closed ajunB7 closed 2 years ago
@ajuni7 Thanks for the issue. At the moment there is little tooling in jsonapi-rails
to handle relationship endpoints. You should get by by not using deserializable_resource
and instead manually dealing with params[:_jsonapi]
.
This is not ideal, but it's the current situation.
Thanks for the quick response @beauby. I was wondering, in Rails is there a way to manually call the Deserializer on a hash?
For the case where the data isn't null, this workaround would be feasible given we can manually call the deserializer when needed.
Edit: I found out that its possible to do so with
JSONAPI::Rails::DeserializableResource.new(json_api_params).to_h
@ajuni7 I updated your comment, but yeah you got the idea.
According to the spec: http://jsonapi.org/format/#crud-updating-relationships
is a valid request. However, I'm seeing the following error: The request MUST include a single resource object as primary data.