Repository navigation
Conversation
With a resource-level output, ObjectMapperProvider handed the output class to PATCH, PUT and DELETE: DELETE did not remove the entity and PATCH overwrote unsent fields.
1 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a resource mapped to an entity (
stateOptions+#[Map]), a resource-leveloutputwas used as the mapping target byObjectMapperProvideron every method. PATCH, PUT and DELETE then received the output class as their state instead of the resource:DELETEanswered successfully and did not remove the entity, the output class is not the class the input mapper expects and Doctrine has no manager for itPATCHdiscarded the object to populate, a new resource was built from the body and unsent fields were overwritten (Expected argument of type "string", "null" given at property path "description"when the property is nullable or has a default)The provider now maps to the resource class on unsafe methods. Safe methods (
GET,HEAD,OPTIONS,QUERY) and non-HTTP operations keep mapping to the output class.This is the provider change from #8497, on its own. The response body of a mapped write with an
outputis not addressed here.