-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Add enhanced XML documentation to MPG generator operation methods #53473
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
Conversation
Co-authored-by: live1206 <[email protected]>
...client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/BarCollection.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: live1206 <[email protected]>
Instead of using FormattableString with raw XML tags that get HTML-encoded, now using XmlDocStatement API to construct structured XML documentation. This ensures proper XML rendering without encoding issues. - Created BuildEnhancedXmlDocs method that constructs XmlDocStatement objects - Builds list with items for Request Path, Operation Id, API Version, and Resource - Uses XmlDocSummaryStatement to properly wrap the summary content - XmlDocs.Update() is called to update the summary with structured statements This addresses the reviewer's feedback to use XmlDocStatement construction. Co-authored-by: live1206 <[email protected]>
|
@copilot merge latest main branch and resolve the conflicts. |
After merging main branch and resolving conflicts, regenerated all test projects to reflect the updated generator changes. The XML documentation now uses proper XmlDocStatement construction, resulting in correctly formatted XML tags instead of HTML-encoded entities. Generated documentation now properly shows: - <list type="bullet"> instead of <list type="bullet"> - <item>, <term>, <description> tags without encoding - Properly formatted operation metadata (Request Path, Operation Id, API Version, Resource) Co-authored-by: live1206 <[email protected]>
Merged latest main branch and regenerated test projects. The merge had one conflict in The generated documentation now correctly shows XML tags without HTML encoding:
Commits: |
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
Adds enhanced XML documentation to Azure Management Plane Generator operation methods, including Request Path, Operation Id, Default Api Version, and Resource information using structured XmlDocStatement objects for proper XML rendering.
- Implements
BuildEnhancedXmlDocsmethod using structuredXmlDocStatementAPI instead of raw strings - Updates operation method documentation with metadata in a bulleted list format
- Calls
BuildEnhancedXmlDocsduring implicit conversion toMethodProviderto apply documentation
...nerator.Management/src/Providers/OperationMethodProviders/ResourceOperationMethodProvider.cs
Outdated
Show resolved
Hide resolved
...nerator.Management/src/Providers/OperationMethodProviders/ResourceOperationMethodProvider.cs
Outdated
Show resolved
Hide resolved
...nerator.Management/src/Providers/OperationMethodProviders/ResourceOperationMethodProvider.cs
Show resolved
Hide resolved
...nerator.Management/src/Providers/OperationMethodProviders/ResourceOperationMethodProvider.cs
Show resolved
Hide resolved
...nerator.Management/src/Providers/OperationMethodProviders/ResourceOperationMethodProvider.cs
Show resolved
Hide resolved
...nerator.Management/src/Providers/OperationMethodProviders/ResourceOperationMethodProvider.cs
Show resolved
Hide resolved
...nerator.Management/src/Providers/OperationMethodProviders/ResourceOperationMethodProvider.cs
Outdated
Show resolved
Hide resolved
...nerator.Management/src/Providers/OperationMethodProviders/ResourceOperationMethodProvider.cs
Outdated
Show resolved
Hide resolved
- Removed BuildEnhancedDescription method which was a no-op - Changed line 87 to use original assignment: _description = description ?? _convenienceMethod.Signature.Description - Changed BuildEnhancedXmlDocs return type from XmlDocProvider? to void since return value is not used - Simplified method by directly updating existingXmlDocs instead of returning it Addresses reviewer feedback to remove redundant code. Co-authored-by: live1206 <[email protected]>
...client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/BarCollection.cs
Show resolved
Hide resolved
|
/check-enforcer override |
Add Enhanced Documentation to MPG Generator
Summary
Added detailed XML documentation to operation methods in the Azure Management Plane Generator (MPG), including Request Path, Operation Id, Default Api Version, and Resource information using structured
XmlDocStatementobjects.Implementation
BuildEnhancedXmlDocsmethod inResourceOperationMethodProviderXmlDocStatementAPI to construct structured XML documentationXmlDocSummaryStatementfor proper XML renderingApproach
The implementation uses the
XmlDocStatementAPI from the TypeSpec generator to build structured XML documentation instead of raw FormattableString content. This ensures XML tags are rendered properly without HTML encoding issues.Code Structure:
XmlDocStatementobjects for each list item (<item>,<term>,<description>)<list type="bullet">tagsXmlDocSummaryStatementXmlDocswith the structured summary viaexistingXmlDocs.Update(summary: summaryStatement)This approach matches the pattern used in
PropertyDescriptionBuilder.csfrom the TypeSpec generator and ensures proper XML rendering in the generated code.Generated Output
The generated documentation now properly renders XML tags:
Fixes #53219
Original prompt
Fixes #53219
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.