- Notifications
You must be signed in to change notification settings - Fork11.7k
[JSON:API] add tests for type, included merge and id in attributes#57589
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:json-api-resource
Are you sure you want to change the base?
Conversation
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
| publicfunctiontestResourceTypeIsPickedFromMorph() | ||
| { | ||
| Relation::morphMap([JsonApiModel::class =>'json-api-model']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Oh, yeah, that's what I get for doing it during work break. Will get back to this in a bit 👍
…-resourceSigned-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
| 'email' =>'deputy@example.com', | ||
| ], | ||
| ],$responseData['included'][0]); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@timacdonald need your input on this and how it should be affected, especially when the resource (e.g.,UserResource) needsid,name, andemail values to be available, but the relationship only loads partial values.

Uh oh!
There was an error while loading.Please reload this page.
Added failing test to assert that:
I'm unsure how the intended way will be to test the data so picked what I found around other tests.