-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Add enhanced XML documentation to MPG generator Get methods in Mockable extensions #53549
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
- Updated MockableResourceProvider.BuildGetMethod to copy XML documentation - Get methods in Mockable extension classes now include detailed documentation - Documentation includes Request Path, Operation Id, and Default Api Version - All test projects regenerated and verified Co-authored-by: live1206 <[email protected]>
...pec/src/Generated/Extensions/MockableAzureGeneratorMgmtTypeSpecTestsResourceGroupResource.cs
Show resolved
Hide resolved
- Updated MockableResourceProvider to copy XmlDocs from singleton resource Get methods - Singleton getters like GetFooSettings() now include detailed documentation - Documentation includes Request Path, Operation Id, Default Api Version, and Resource Co-authored-by: live1206 <[email protected]>
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 enhances XML documentation for mockable resource methods by copying detailed API documentation from the underlying resource methods. The generator now propagates enhanced XML documentation (including request path, operation ID, API version, and resource information) from collection Get methods and singleton resource Get methods to their corresponding wrapper methods in mockable resource classes.
- Adds logic to copy XML documentation summaries from source methods to generated wrapper methods in mockable resources
- Updates generated test files to include enhanced XML documentation with structured lists containing API metadata
Reviewed Changes
Copilot reviewed 1 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| MockableResourceProvider.cs | Implements XML documentation copying for singleton and collection resource Get methods |
| MockableAzureGeneratorMgmtTypeSpecTestsTenantResource.cs | Generated file updated with enhanced XML docs for quota status methods |
| MockableAzureGeneratorMgmtTypeSpecTestsSubscriptionResource.cs | Generated file updated with enhanced XML docs for Playwright quota methods |
| MockableAzureGeneratorMgmtTypeSpecTestsResourceGroupResource.cs | Generated file updated with enhanced XML docs for various resource Get methods |
...t-TypeSpec/src/Generated/Extensions/MockableAzureGeneratorMgmtTypeSpecTestsTenantResource.cs
Show resolved
Hide resolved
...t-TypeSpec/src/Generated/Extensions/MockableAzureGeneratorMgmtTypeSpecTestsTenantResource.cs
Show resolved
Hide resolved
...t-csharp-mgmt/generator/Azure.Generator.Management/src/Providers/MockableResourceProvider.cs
Show resolved
Hide resolved
...t-csharp-mgmt/generator/Azure.Generator.Management/src/Providers/MockableResourceProvider.cs
Show resolved
Hide resolved
...t-TypeSpec/src/Generated/Extensions/MockableAzureGeneratorMgmtTypeSpecTestsTenantResource.cs
Show resolved
Hide resolved
e9e5eeb to
c0a69b0
Compare
|
/check-enforcer override |
Plan: Add Missing Documentation to MPG Generator Get Methods ✅
This issue addresses missing documentation in the management plane generator (MPG) for Get methods in Mockable extension classes.
Problem
The Get methods in
MockableXxxResourceGroupResource.csfiles were missing detailed XML documentation that includes:Analysis
The documentation is generated in
ResourceOperationMethodProvider.BuildEnhancedXmlDocs()but this was not being applied to the Get methods created inMockableResourceProvider.BuildGetMethod().Solution Implemented
MockableResourceProvider.BuildGetMethod()to copy enhanced XML documentation for collection-based resourcesMockableResourceProvider.BuildMethodsForResource()to copy enhanced XML documentation for singleton resourcesChanges Made
BuildFactoryMethodProvider()method to ResourceClientProvider - builds complete MethodProvider with enhanced XmlDocs for singleton resource factory methodsBuildMockableGetMethodProvider()method to ResourceCollectionClientProvider - builds complete MethodProvider with enhanced XmlDocs for collection Get methodsMockableResourceProvider.BuildMethodsForResource()to use ResourceClientProvider.BuildFactoryMethodProvider() for singleton resourcesMockableResourceProvider.BuildMethodsForResource()to use ResourceCollectionClientProvider.BuildMockableGetMethodProvider() for collection Get methodsBefore & After - Collection Resources
Before:
After:
Before & After - Singleton Resources
Before:
After:
Files Changed
ResourceClientProvider.cs- Added BuildFactoryMethodProvider() methodResourceCollectionClientProvider.cs- Added BuildMockableGetMethodProvider() methodMockableResourceProvider.cs- Updated to use the new methods, removed BuildGetMethod() static method✅ Ready for review
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.