-
Notifications
You must be signed in to change notification settings - Fork 25.2k
How to use XML comments with Minimal APIs? #24659
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
Comments
@rafikiassumani-msft How to use XML comments with Minimal APIs? |
@Rick-Anderson FYI, I saw David Fowler comment on Stack Overflow that this isn't supported. |
@Rick-Anderson @serpent5 @davidfowl If XML comments aren't supported for minimal APIs, how can I get the same effect using any other available method? Looks like all I need is for the generated JSON to include a Summary element, as in the example on the page: "delete": {
"tags": [
"Todo"
],
"summary": "Deletes a specific TodoItem.",
"parameters": [
],
"responses": {
"200": {
"description": "Success"
}
}
}, Any way I can generate that Summary element using any other Minimal API available method? |
Thank you for contacting us. Due to a lack of activity on this discussion issue we're closing it in an effort to keep our backlog manageable. If you believe there is a concern which hasn't been addressed, please file a new issue. |
In the latest .NET 7 preview, you can use the new With regard to XML docs specifically, we are tracking this at dotnet/aspnetcore#39927. There are some workarounds in the linked issues. |
Thanks for contacting us. We believe that the question you've raised have been answered. If you still feel a need to continue the discussion, feel free to reopen it and add your comments. |
The XML comments section describes how to generate an XML comments file using SwaggerGen options but all the examples are based in XML comments placed in MVC controller methods as opposed to minimal APIs.
How can I generate the summary element in the Swagger JSON file so the Swagger UI doc presents XML comments as documentation for each of the operations?
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: