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

Change create/update options in resources to match JSON:API Type field #190

Merged
merged 2 commits into from Mar 11, 2021

Conversation

omarismail
Copy link
Contributor

@omarismail omarismail commented Mar 10, 2021

Description

Currently a lot of the Create/UpdateOptions structs for various resources have an ID attribute that represents the primary field in JSON:API. This is misleading, as JSON:API indicates that this field is a Type field.

This PR is to make the fields more accurately represent the JSON:API spec. It also removes the frequent options.ID = "" as that is not necessary.

Testing plan

No changes. Run all the tests locally.

Output from tests

$ 
...

External links

@omarismail omarismail requested a review from a team Mar 10, 2021
Copy link
Member

@chrisarcand chrisarcand left a comment

Love this, thanks for digging in to it.

I think even this message we might want to make very clear to users unfamiliar that this field is literally not a settable field or their concern whatsoever, it just a public field that needs to be present.

// Type is a public field utilized by JSON:API to set the resource type via the field tag.
// It is not a user-defined value and does not need to be set.

Maybe? Type is the required field makes it seem like I need to care about it.

@omarismail omarismail requested a review from a team Mar 10, 2021
@omarismail
Copy link
Contributor Author

omarismail commented Mar 10, 2021

I think even this message we might want to make very clear to users unfamiliar that this field is literally not a settable field or their concern whatsoever, it just a public field that needs to be present.

Makes sense, I like this wording. Updated.

@omarismail omarismail merged commit 77fb7aa into master Mar 11, 2021
2 checks passed
@omarismail omarismail deleted the omarismail/jsonapi-type branch Mar 11, 2021
This was referenced Feb 21, 2022
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.

None yet

2 participants