-
-
Notifications
You must be signed in to change notification settings - Fork 961
Open
Labels
Description
API Platform version(s) affected: x.y.z
Description
Symfony PR #62574 (commit 35b1aec) improves BackedEnumNormalizer error messages. This change was:
- Merged to 8.1 branch (Dec 2025)
- Accidentally cherry-picked into 8.0.5 — which broke this demo (see PR #587 comment)
- Reworked in 8.0.6 (commit
388c311) — theexpectedTypes = nullbehavior was removed from 8.0.x - The demo jumped from v8.0.4 → v8.0.7, skipping the broken v8.0.5
On the current Symfony 8.1 branch, BackedEnumNormalizer distinguishes:
- Type mismatch (TypeError):
expectedTypes = [$backingType] - Invalid value (ValueError):
expectedTypes = ['int', 'string'], message ="The data must belong to a backed enumeration of type $type"
How to reproduce
Symfony has modified its behavior for BackendEnumDenormalizer in Symfony 8.1. This change is not supported by API Platform and may cause troubles on later migration.
Reproducer: api-platform/demo#617
Possible Solution
Support both Symfony 8.0 and 8.1 behaviors.
Additional Context
PR in progress...
Reactions are currently unavailable