Skip to content

Conversation

ceesvanegmond
Copy link
Contributor

@ceesvanegmond ceesvanegmond commented Oct 7, 2025

Q A
Branch? main
Tickets Closes #7405 (added functionality)
License MIT
Doc PR

This PR adds functionality to override the description and other fields from YAML. Previously, this was possible using annotations, but currently, it's not possible to override only the description. While it is possible to override the response HTTP status, doing so replaces the entire key. With this change, you can now override just the description field.

@soyuka
Copy link
Member

soyuka commented Oct 7, 2025

can you target 4.2?

@ceesvanegmond ceesvanegmond changed the base branch from main to 4.2 October 7, 2025 08:46
@ceesvanegmond
Copy link
Contributor Author

@soyuka 👍

Copy link
Contributor

@VincentLanglet VincentLanglet left a comment

Choose a reason for hiding this comment

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

This seems fine to me and just require test

@VincentLanglet
Copy link
Contributor

And I wonder if the same is required for XMLExtractor

@ceesvanegmond
Copy link
Contributor Author

ceesvanegmond commented Oct 7, 2025

@VincentLanglet I will add tests and also fix this for XMLExtractor

EDIT: XMLExtractor already works https://github.com/ceesvanegmond/core/blob/fix/override-description-in-yaml-operation/src/Metadata/Extractor/XmlResourceExtractor.php#L205

@VincentLanglet
Copy link
Contributor

EDIT: XMLExtractor already works ceesvanegmond/core@fix/override-description-in-yaml-operation/src/Metadata/Extractor/XmlResourceExtractor.php#L205

It creates an array while it would be better to instanciate a Route object

@ceesvanegmond
Copy link
Contributor Author

@VincentLanglet I guess you mean new Response(). Just added it for XML.
Cannot get phpunit locally to work (this component phpunit setup) so have to look into that a little bit later.

@soyuka soyuka marked this pull request as ready for review October 8, 2025 08:35
@soyuka
Copy link
Member

soyuka commented Oct 8, 2025

Note that with Symfony deprecating the xml configuration less and less people are going to use that.

@soyuka soyuka merged commit 1094a52 into api-platform:4.2 Oct 8, 2025
113 of 114 checks passed
@soyuka
Copy link
Member

soyuka commented Oct 8, 2025

thanks!

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.

Miss an easy way to override a response description without changing the content
3 participants