-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Document TypeSpec body parameter naming conventions for PATCH and POST operations #39733
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
- Created comprehensive guide explaining PATCH and POST body parameter naming - Added before/after examples showing SDK generation impact - Documented the use of @@clientName decorators for consistent naming - Included real-world examples from existing Azure services Co-authored-by: ArthurMa1978 <[email protected]>
Next Steps to Merge⌛ Please wait. Next steps to merge this PR are being evaluated by automation. ⌛Comment generated by summarize-checks workflow run. |
- Explains relationship between TypeSpec decorators and BodyParameterNameNormalizer - Compares code generator approach vs TypeSpec decorator approach - Provides detailed rationale for recommended TypeSpec-native solution - Includes FAQ and implementation guidance Co-authored-by: ArthurMa1978 <[email protected]>
- Link to comprehensive body parameter naming guide - Makes best practices discoverable for new TypeSpec developers - Ensures consistent parameter naming across Azure services Co-authored-by: ArthurMa1978 <[email protected]>
- Add note explaining the presence of both generic and C#-specific decorators - Clarify that C#-specific decorators override defaults - Addresses potential confusion from multiple decorator sets in the same file Co-authored-by: ArthurMa1978 <[email protected]>
|
@copilot please work on the codegen to enable this feature |
The code generator you're referring to ( This repository contains API specifications and TypeSpec definitions. The documentation I created shows how to use TypeSpec's If you want to implement this feature in the code generator itself, that work would need to be done in the Would you like me to:
|
Purpose of this PR
@@clientNamedecoratorsDocumentation Added
Created comprehensive documentation for TypeSpec body parameter naming:
Conventions
"patch""content"Implementation
Files Created
Rationale
Uses TypeSpec's native
@@clientNamedecorators instead of modifying SDK code generators because:Generated SDK Example
Note on Code Generator Approach
The original issue references
BodyParameterNameNormalizer.csin theAzure/azure-sdk-for-netrepository. This PR provides a TypeSpec-based solution that works immediately without code generator changes. If code generator modifications are preferred, that work would need to be done in theazure-sdk-for-netrepository, not in thisazure-rest-api-specsrepository.Due diligence checklist
tspconfig.yamltemplates:Getting help
Purpose of this PRandDue diligence checklist.write accessper aka.ms/azsdk/access#request-access-to-rest-api-or-sdk-repositoriesNext Steps to Mergecomment. It will appear within few minutes of submitting this PR and will continue to be up-to-date with current PR state.queuedstate, please add a comment with contents/azp run.This should result in a new comment denoting a
PR validation pipelinehas started and the checks should be updated after few minutes.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.