-
-
Notifications
You must be signed in to change notification settings - Fork 895
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
Upgrade symfony/framework-bundle 6.4.4 => 6.4.6 broke BackedEnum item serialization #6279
Comments
#6264 ? |
I try to revert one package at one to find which one is faulty. |
This is related to symfony/symfony/pull/54315 If I set |
Before change:
after update to 6.4.6:
|
The problem here is that If I set |
should we move up graphql? |
I think that related to all If I set all
I imagine all Api Platform item normalizer should be higher priority than Symfony normalizers |
thanks, let me try that |
I was having a look too, and here is a branch with a functional test for backed enum resources based on this https://github.com/GwendolenLynch/api-platform-core/tree/fix/issues/6264 Passes with the priority set at |
I have an ongoing work to support enums with hydra it's a bit complex RDF-wise (soyuka@48db6fa) for now I think that only graphql supports them. |
Yeah, I have added a personal TODO for JSON:API based on this, but just base testing on JSON works in a basic sense (hence the target of the tests above), but now breaks with the upstream change. |
Why closing this issue. Problem occurs for all item normalizers: JSON, JSONLD and GraphQL |
Because API Platform does not support enums as resources except for GraphQl, I see this out of my scope although it is planned for API Platform 3.4. Now #6285 (comment) is a valid solution until it's reverted inside Symfony. Or feel free to provide a fix but moving our normalizer priorities is hard. |
… translatable (GwendolenLynch) This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [Serializer] reset backed_enum priority, and re-prioritise translatable | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #54478 Fix api-platform/core#6285 Fix api-platform/core#6279 | License | MIT - `serializer.normalizer.translatable` -920 (was -890) - `serializer.normalizer.backed_enum` -915 (originally -915, changed to -880) Floating this as as solution to the knock-on issues from #54478 Context: - #54478 (comment) - api-platform/core#6288 Commits ------- b559aa5 [Serializer] reset backed_enum priority, and re-prioritise translatable
Ok, I thought this was kind of official since a read this article https://les-tilleuls.coop/blog/exposez-vos-enums-avec-api-platform. My bad |
Mhh I completely missed this @ambroisemaupate my bad as I need enums on API P this month and found out it wasn't working properly... Anyways, a fix has come to symfony regarding this issue, let's see what's wrong at #6298 as I think that something is definitely off regarding the support of enums. |
After packages upgrade (Symfony and Api PLatform) all Enums resource serialization broke leading in
Expected normalized relation to be an IRI, array, \\ArrayObject or null
error for relations with Enum normalization.I don't know if it's related to Api Platform or Symfony?
Maybe related to #6264
Resource
Symptoms:
Enum operations do not output Enum normalized objects anymore, but their raw value.
Before upgrade:

After upgrade:

The text was updated successfully, but these errors were encountered: