-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Support processing XML comments on [AsParameters] parameter #63166
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR adds support for processing XML comments on properties of [AsParameters]
parameter classes in OpenAPI documentation generation. The feature enables XML documentation comments on individual properties within parameter classes to be reflected in the generated OpenAPI documentation.
Key Changes:
- Added a new overload of
CreateDocumentationId
method to generate documentation IDs for properties using container type and property name - Enhanced the OpenAPI operation transformer to process parameter descriptions with property-level metadata and apply XML comments
- Added comprehensive test cases covering various scenarios including mixed parameters, binding sources, and examples
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
OperationTests.MinimalApis.cs | Added test cases for [AsParameters] with XML comments including parameter classes and validation scenarios |
XmlCommentGenerator.Emitter.cs | Added new CreateDocumentationId overload and logic to process property-level XML comments for AsParameters |
Multiple snapshot files | Updated generated code snapshots to include the new functionality and test data |
{ | ||
if (operation.RequestBody is not null) | ||
{ | ||
operation.RequestBody.Description = propertyComment.Summary ?? propertyComment.Description; |
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.
Is this the right precedence? Just from the naming it looks like it should be the other way around.
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.
I believe you're right. I believe this should be .Value, .Returns then .Summary to match other property-based comments.
c2c1a60
to
da93209
Compare
da93209
to
c4f153c
Compare
Closes #61936.