Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #23404 [Serializer] AbstractObjectNormalizer: Allow to disabl…
…e type enforcement (ogizanagi) This PR was merged into the 3.4 branch. Discussion ---------- [Serializer] AbstractObjectNormalizer: Allow to disable type enforcement | Q | A | ------------- | --- | Branch? | 3.4 <!-- see comment below --> | Bug fix? | no | New feature? | yes <!-- don't forget updating src/**/CHANGELOG.md files --> | BC breaks? | no | Deprecations? | no <!-- don't forget updating UPGRADE-*.md files --> | Tests pass? | yes (failure unrelated) | Fixed tickets | N/A <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | N/A This allows to denormalize simple DTOs with public properties using the property-info component and the `ObjectNormalizer`. The raised exception is not really useful in such cases, as it cannot be easily handled gracefully to build a proper violation response (too generic and no real hint on the complete attribute path for instance). Instead, I use the validator component to validate my DTOs and the properties' types, get a proper violation list, and build a response from it. I wasn't really inspired for the `DISABLE_TYPE_ENFORCEMENT` name. Commits ------- 959ac2a [Serializer] AbstractObjectNormalizer: Allow to disable type enforcement
- Loading branch information