⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

fix(validator): validate entities after ObjectMapper transformation#7731

Merged
soyuka merged 4 commits intoapi-platform:mainfrom
soyuka:fix/7725
Feb 8, 2026
Merged

fix(validator): validate entities after ObjectMapper transformation#7731
soyuka merged 4 commits intoapi-platform:mainfrom
soyuka:fix/7725

Conversation

@soyuka
Copy link
Member

@soyuka soyuka commented Feb 6, 2026

Q A
Branch? main
Tickets Fixes #7725
License MIT
Doc PR
  • Adds ValidateProcessor to validate mapped entities before persistence
  • Prevents database constraint violations (500) by catching validation errors (422)
  • Fixes UniqueEntity and other entity-level constraints not being validated

@soyuka soyuka force-pushed the fix/7725 branch 2 times, most recently from 895ecc3 to b4b1e3c Compare February 8, 2026 08:38
soyuka and others added 2 commits February 8, 2026 09:48
…pi-platform#7725)

| Q             | A
| ------------- | ---
| Branch?       | main
| Tickets       | Fixes api-platform#7725
| License       | MIT
| Doc PR        | ∅

* Split ObjectMapperProcessor into ObjectMapperInputProcessor (priority 50) and ObjectMapperOutputProcessor (priority 150) on the main processor chain, allowing ValidateProcessor (priority 80) to slot in between
* Add ObjectMapperInputListener/ObjectMapperOutputListener for Symfony event listeners mode
* Enable ValidateProcessor decorating api_platform.state_processor.main at priority 80
* Make $decorated nullable in ObjectMapperInput/OutputProcessor
* Rewrite listeners to delegate to processors instead of duplicating logic
* Wire standalone processors (null decorated) in events mode config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
soyuka and others added 2 commits February 8, 2026 17:55
Replaced by ObjectMapperInputProcessor and ObjectMapperOutputProcessor.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@soyuka soyuka merged commit 28834e6 into api-platform:main Feb 8, 2026
148 of 149 checks passed
@soyuka soyuka deleted the fix/7725 branch February 8, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Symfony 7.4 Validate mapped entity when using ObjectMapper with stateOptions

1 participant