Skip to content

Conversation

Shigawire
Copy link

According to the Spec (https://jsonapi.org/format/#document-resource-object-linkage), empty relationships are null by default. Object.new is roughly equal to an empty JSON ({}) in context of this deserializer. It is hard for us to recognize missing or non-present relationships if we have an object with no attributes. To avoid this, instead of a PORO, just nil is returned as reference to a non-present relationships.

According to the Spec (https://jsonapi.org/format/#document-resource-object-linkage), empty relationships are null by default. Object.new is roughly equal to an empty JSON ({}) in context of this deserializer. It is hard for us to recognize missing or non-present relationships if we have an object with no attributes. To avoid this, instead of a PORO, just nil is returned as reference to a non-present relationships.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant