-
Notifications
You must be signed in to change notification settings - Fork 349
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
[JsonApiSerializer] Relationship can't be called links #369
Comments
This is quite easy to fix, but I don't understand why the merge is happening in the first place. Would the PR for this be welcomed? |
This is a problem with Right now the transformer only really has the IMO it would make more sense for the transformer to have additional method hooks for this stuff: class Transformer
{
function transform($data): array {}
function id($data): string {}
function type($data): string {}
} If the serializer is going to continue hoisting the attributes, it should probably be prefixing them to reduce collisions ( |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 4 weeks if no further activity occurs. Thank you for your contributions. |
JsonApiSerializer arbitrarily merges
links
attribute on a Model with document (resource) links in a response.Apparently, it's not a bug and is done explicitly in the
item
method of serializer, but this behavior violates JSON API spec as there are clear requirements as to what should go into link object and clashes with quite a few popular use cases.Imagine Goodreads where each book has links (e.g. Amazon, Google Play etc.). If Goodreads built an API using Fractal, they'll have this:
instead of
I hope this example clears the confusion as to what the issue is.
The text was updated successfully, but these errors were encountered: