Skip to content

Handle unexpected relationships in json? #120

Description

@scotsimon

We have run into situations where the API gets a bit ahead of our application and the endpoint returns a relationship that hasn't been defined in the application's object model yet.

For example, a JSONAPI ResourceObjectDescription might include a relationship for 'person' and 'address'. The API returns /included data for 'person', 'address' and 'email'.

In this case, the decoding fails and returns a message along the lines of:
Out of the 3 includes in the document, the 1st one failed to parse: Found JSON:API type ‘email’ but expected one of ‘person’, ‘address’

The API team is trying to avoid strict API versioning, so I have been asked if there is a way to circumvent this error in the event that unexpected data is found in the json.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions