Skip to content

Conversation

@VincentLanglet
Copy link
Contributor

Q A
Branch? 4.2
Tickets Closes #7664
License MIT
Doc PR api-platform/docs#...

@VincentLanglet VincentLanglet requested a review from soyuka January 14, 2026 18:19
@VincentLanglet VincentLanglet marked this pull request as ready for review January 14, 2026 18:19
@soyuka soyuka requested a review from Copilot January 16, 2026 15:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an issue where error responses incorrectly lose content when an operation has no output configured (output: false). The fix ensures that error responses always include their content schemas, even when the main operation response is configured to have no output.

Changes:

  • Modified buildOpenApiResponse to accept an isErrorResponse parameter to distinguish error responses from regular responses
  • Updated the noOutput logic to only apply to non-error responses

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/OpenApi/Factory/OpenApiFactory.php Added isErrorResponse parameter to prevent error responses from incorrectly inheriting noOutput behavior
src/OpenApi/Tests/Factory/OpenApiFactoryTest.php Added test case for operations with output: false to verify error responses retain their content

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@soyuka soyuka changed the title fix(metadata): fix loosing content on error reponse with no output fix(metadata): fix losing content on error reponse with no output Jan 16, 2026
@soyuka soyuka merged commit 2721655 into 4.2 Jan 16, 2026
255 checks passed
@soyuka soyuka deleted the fix/7664 branch January 16, 2026 15:43
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.

3 participants