core icon indicating copy to clipboard operation
core copied to clipboard

fix(JsonLd): Ignore context resource_class when it is populated with an interface or an abstract class.

Open ambroisemaupate opened this issue 1 year ago • 2 comments

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 avatar Apr 03 '24 18:04 ambroisemaupate

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.

ambroisemaupate avatar Apr 03 '24 18:04 ambroisemaupate

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.

soyuka avatar Apr 04 '24 14:04 soyuka

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 03 '24 22:06 stale[bot]

can you send me the resource and a use case (even curl) so that I add a test?

soyuka avatar Jun 04 '24 11:06 soyuka