-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Description to ProducesResponseType (and others) for better OpenAPI document creation #58193
Conversation
…structor and static methods to ProducesResponseTypeMetadata for correct description overloads
… comment Also removed new constructors based on Safiaś comment
Hey @captainsafia, ASP.NET Core team and community! I'm extremely excited to be able to create this PR! I'm dedicating this to the .NET and OpenAPI community, and I shouldn't forget to mention hacktoberfest as well! I'd love to get this merged or marked as accepted in the month of October, so keep the PR feedback coming! I've been working on this for a while since talking to Safia about it at the MVP Summit 2024, and I'm very grateful for the opportunity. Now, let's talk about some details 😁. The state of the PRI believe the PR is coming along nicely, but I find it difficult to say if it is done. I would need help from the ASP.NET Core team or community to get the following answered:
And finally: Please let me know what other changes need to be made to make this work functionally! Again, my goal is to get this to an accepted (or even merged!) state in october, if possible! |
@dotnet-policy-service agree |
Hi @mkArtakMSFT and @adityamandaleeka ! When can I expect a review and response to my comment with questions? I am very excited to get started :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @captainsafia! Thanks so much! I will look into this as soon as possible. |
Hi @captainsafia ! I've implemented your suggestions, please see the new commit and let me know if there's anything I can still do! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for adding tests and the M.A.OpenApi changes.
…API document creation (#58193) * Started adding Description to several attributes * Add new properties to unshipped apis * Some more progress of adding Description in some places * Small improvements based on API review comments * Added missing modifier to property * Make changes in unshipped.txt so the http project builds * Add Description to OpenApiRouteHandlerBuilderExtensions and extra constructor and static methods to ProducesResponseTypeMetadata for correct description overloads * Changed code to follow overload rules and fix compile issues * Fix minor typo * Remove code from OpenApiRouteHandlerBUilderExtensions based on Safiaś comment Also removed new constructors based on Safiaś comment * Fix incorrect XML Comment * Fixed some more Public API issues * Add unit test * Add some more unit tests * Remove unnecessary set from interface * Remove unnecessary change in public api shipped file * Also update unshipped file so the build succeeds! * Apply the new Description in response models
Add Description to ProducesResponseType (and other types) for better OpenAPI documents in Controllers
Description
This pull request introduces the concept of adding OpenAPI's description to responses returned by ASP.NET Core. The changes include adding a
Description
property to response metadata interfaces, classes, and attributes, as well as updating related tests.As discussed in #55656 , Minimal API's are not (or minimally) addressed in this PR. This should instead be built in #57963 (which I would love to work on in the future!)
Fixes #55656