-
Notifications
You must be signed in to change notification settings - Fork 334
Add correspondingMethodParams to input parameter types for override decorator support #9537
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
Co-authored-by: JoshLove-msft <[email protected]>
| p: SdkHttpParameter | SdkModelPropertyType, | ||
| ): InputMethodParameter[] | undefined { | ||
| // correspondingMethodParams is only available on SdkHttpParameter and SdkModelPropertyType | ||
| const correspondingParams = (p as any).correspondingMethodParams; |
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.
@copilot we should be using methodParametersSegements instead.
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.
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.
Updated to use methodParameterSegments in commit 3174687. The function now iterates through the 2D array structure and extracts the last segment from each array which represents the actual method parameter.
Co-authored-by: JoshLove-msft <[email protected]>
Co-authored-by: JoshLove-msft <[email protected]>
Co-authored-by: JoshLove-msft <[email protected]>
Flows
correspondingMethodParamsmetadata from TCGC through the emitter to the C# generator. This enables mapping from convenience method parameters to protocol parameters for@overridedecorator scenarios.TypeScript Changes
correspondingMethodParams?: InputMethodParameter[]toInputQueryParameter,InputPathParameter,InputHeaderParameter,InputBodyParameter, andInputEndpointParametergetCorrespondingMethodParams()helper inoperation-converter.tsto extract method parameters from TCGC'smethodParameterSegments(a 2D array structure)fromQueryParameter,fromPathParameter, etc.) to populate the propertyC# Changes
CorrespondingMethodParamsproperty toInputParameterbase classInputQueryParameterConverter,InputPathParameterConverter,InputHeaderParameterConverter,InputBodyParameterConverter,InputEndpointParameterConverter) to deserialize the propertyImplementation Details
The implementation uses TCGC's
methodParameterSegmentsproperty, which is a 2D array where:SdkMethodParameterProperty is optional and uses type casting
(p as any).methodParameterSegmentsto handle cases where TCGC may not provide it.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.