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(JsonLd): Ignore context resource_class when it is populated with an interface or an abstract class. #6284

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ambroisemaupate
Copy link
Contributor

Q A
Branch? main
Tickets Closes #6251
License MIT

I put null !== $previousResourceClass && $isResourceClass condition before testing if it's an abstract or interface in order to avoid using \ReflectionClass for every Item normalization. Just for this specific case for performances sake.

@ambroisemaupate
Copy link
Contributor Author

I can't figure out how to create a Test Case for this. I don't need a complete ApiTestCase, just creating some objects and a working and configured JsonLd serializer.

@soyuka
Copy link
Member

soyuka commented Apr 4, 2024

Look at the ItemNormalizerTest? A functional test would be awesome imo, for this either add a functional test like https://github.com/api-platform/core/blob/main/tests/Functional/Parameters/ParameterTests.php or a behat test.

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.

Interfaced object relations do not resolve JsonLd inheriting resource types
2 participants