Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
I have been testing the OpenAPI document generation in the .NET 10 Preview 4 version of the aspnetcore project for controller-based APIs (mini APIs are not tested or discussed here).
Expected Behavior
I encountered several issues related to how XML comments interact with OpenAPI generation:
-
XML
<response>
comments on controller action methods:
The official documentation mentions support for XML<response>
tags, but these do not seem to be translated into OpenAPIpaths.responses
. That is, the responses described in XML are missing from the generated OpenAPI YAML/JSON under the paths section. -
XML comments on controller classes:
- The class-level
<summary>
element is not converted into OpenAPItags.name
. - The class-level
<remarks>
element is not converted into OpenAPItags.description
.
For comparison, applying
[Tags("tagName")]
attribute on the controller works fine and the tag name shows up correctly.
Applying[Description("desc")]
attribute on the controller does not translate into the tag's description, either. - The class-level
-
Enum support in OpenAPI schema:
- The current OpenAPI document generation does not correctly support enums.
- Enum options are missing from the generated OpenAPI schema, even though they are present in the XML documentation.
- According to OpenAPI specification, enums can be declared with
enum: ["name1", "name2"]
orenum: [1, 2]
. - It appears this feature is not properly supported or implemented yet in the .NET 10 preview 4 version.
Finally, a question for discussion:
- What is the recommended practice or approach to include enum member (individual enum value) documentation/comments into the OpenAPI documentation? For example, how to make each enum member's XML
<summary>
or other annotations appear in the OpenAPI schema description or extensions?
Would appreciate any guidance or roadmap clarification on these points.
Thanks!
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
10.0.100-preview.4.25258.110
Anything else?
No response