Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

content-specific json.api models #34

Open
engenb opened this issue Mar 10, 2017 · 0 comments
Open

content-specific json.api models #34

engenb opened this issue Mar 10, 2017 · 0 comments

Comments

@engenb
Copy link
Contributor

engenb commented Mar 10, 2017

Relationship Data properties may contain a single ResourceIdentifier or an array of ResourceIdentifiers, based on the type of relationship. To support this, Data is currently a JToken. This is not ideal, as it requires a lot of checks on Data.TokenType for Object or Array.

A far better solution would be an IRelationship or abstract base class, with a custom JsonConverter for that type, that switches deserialization based on TokenType.

The same approach should apply to Resource and other types that have newtonsoft.json types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants