api-platform / core

The server component of API Platform: hypermedia and GraphQL APIs in minutes
https://api-platform.com
MIT License
2.44k stars 869 forks source link

[Serializer] Group ignored without manual clear cache #5293

Closed louismariegaborit closed 1 year ago

louismariegaborit commented 1 year ago

API Platform version(s) affected: 2.7.5 with metadata_backward_compatibility_layer: true

Description
If I add or remove a group serializer on a property, I must clear the symfony cache manually to the change works. This problem not appear with metadata_backward_compatibility_layer: false. I can't switch the flag for the moment.

KDederichs commented 1 year ago

Dev or Prod mode? Cause Prod mode would be intended behavior

louismariegaborit commented 1 year ago

Dev and test environment.

Tersoal commented 1 year ago

I have the same problem. Sometimes, embedded entities are serializer, sometimes not. I don't understand why this occur.

soyuka commented 1 year ago

Probably a cache issue we fixed at https://github.com/api-platform/core/pull/5242 can you try to backport this to 2.7 and probably open a PR? Thanks!

louismariegaborit commented 1 year ago

Ok I try.

louismariegaborit commented 1 year ago

I tried but it seems that the class ApiPlatformExtension is ok.
But I saw that the service api_platform.cache_warmer.cache_pool_clearer don't exists in 2.7 with flag is true.
I tried to add the service in the file legacy/api.xml with 2.6 configuration, the service now exists but don't resolve the issue.
Do you have an idea @soyuka ?

stale[bot] commented 1 year ago

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.