Skip to content

[RFC] How to handle improper usage error #1514

@groyoh

Description

@groyoh

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions