-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Milestone
Description
In #1504, I figured out that in some part of the gem we do not make sure that user use the gem properly to match jsonapi specification.
The main example I ran into is when using a relationship that does not include data
and do not use links
and meta
(Ref. #1504 (comment)):
has_one :author do
include_data false
end
# => { relationships: { author: {} } }
This results in an empty relationship and is not allowed by jsonapi specification (http://jsonapi.org/format/#document-resource-object-relationships) but the gem does not prevent the user from doing so.
Should the gem raise an error in such case or let the user figure out on its own that he's using the gem wrongly?