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

fix: custom relationship meta not returned on PaginatedRelatedResourceResponse or PaginatedIdentifierResponse #23

Conversation

haddowg
Copy link
Contributor

@haddowg haddowg commented Dec 19, 2024

Fixes a bug where currently custom meta added to a relationship via withMeta will not be returned on paginated relationship and related endpoints.

Steps to reproduce:

  • add custom meta to a toMany relationship in a Resource class for a schema that supports pagination or has default pagination
  • request the the relationship endpoint or the related endpoint (with page query params if not paginated by default)

expected result: custom meta in the top level meta object
actual result: only pagination meta and any meta added directly to the response class will be shown.

have not added a test as there are no other response tests and this would be a fairly significant undertaking, perhaps it could be tested via proxy in the integration tests elsewhere?

@haddowg haddowg force-pushed the fix/relationship-response-meta branch from 6e1ce42 to c3931e5 Compare December 19, 2024 13:34
Copy link
Contributor

@lindyhopchris lindyhopchris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, agree adding tests is going to be a big undertaking so need to leave for now.

@lindyhopchris lindyhopchris merged commit 902408a into laravel-json-api:develop Jan 11, 2025
3 checks passed
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.

2 participants