Repository navigation
fix(openapi): document request body on operations that deserialize - #8598
Merged
Merged
Conversation
This was referenced Sep 28, 2026
soyuka
added a commit
that referenced
this pull request
Sep 29, 2026
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.
A custom
Deletethat declares aninputDTO anddeserialize: truegot norequestBodyin the OpenAPI document, so its payload was undocumented.Two gates hardcoded the same method list.
OpenApiFactory::collectPaths()only built a request body forPATCH,PUTandPOST, andSchemaFactory::buildSchema()returned early for any method outsidePOST,PATCH,PUT,QUERY. Fixing only the first produced arequestBodycarrying an empty schema, so both are needed.Neither specification forbids this. RFC 9110 section 9.3.5 says a client "SHOULD NOT generate content in a DELETE request unless it is made directly to an origin server that has previously indicated, in or out of band, that such a request has a purpose and will be adequately supported" — documenting it is that indication. OpenAPI 3.1 and 3.2 both state that
requestBodyon DELETE "is permitted".The opt-in signal is
$operation->canDeserialize(). It is?booldefaulting tonull(src/Metadata/Operation.php:791) and is resolved to a boolean only at runtime inMainController, sotrue === $operation->canDeserialize()holds only when the user wrotedeserialize: truethemselves. Nothing changes for any existing operation.The test asserts both directions: a
Deletewithinputanddeserialize: truegets a request body whose schema$refs the DTO, and a plainDeletestill getsnulland still builds no input schema.