-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Thread api-version from input JSON to tsp-client emitter options #53750
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
Thread api-version from input JSON to tsp-client emitter options #53750
Conversation
Co-authored-by: JoshLove-msft <[email protected]>
Co-authored-by: JoshLove-msft <[email protected]>
Co-authored-by: JoshLove-msft <[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 enables API version specification for TypeSpec SDK generation by threading the apiVersion field from the unified pipeline input JSON through to the tsp-client init command's emitter options. This allows targeting specific API versions when generating SDKs from TypeSpec projects that use the @versioned decorator.
Key changes:
- Extract
apiVersionfrom input JSON and pass it totsp-client initas--emitter-options "api-version={value}" - Add validation using regex pattern
^[a-zA-Z0-9.-]+$to prevent command injection - Maintain backward compatibility by skipping invalid values with a warning
Co-authored-by: JoshLove-msft <[email protected]>
|
@copilot sync from main |
…ion-to-emitter-options
|
/check-enforcer evaluate |
Description
The unified pipeline input JSON now supports an
apiVersionfield that is passed through to the TypeSpec code generator. This enables targeting specific API versions when generating SDKs from TypeSpec projects using the@versioneddecorator.Additionally, the script now extracts and handles the
sdkReleaseTypefield from the input JSON, displaying a warning to inform users that this parameter is not supported by .NET and requires manual package version updates.Changes:
apiVersionfrom input JSON and pass totsp-client initas--emitter-options "api-version={value}"^[a-zA-Z0-9.-]+$to prevent command injectionsdkReleaseTypefrom input JSONsdkReleaseTypeis provided: "sdkReleaseType is not supported by .NET and user will need to update the package version manually"Example:
{ "apiVersion": "2025-10-01", "sdkReleaseType": "stable", "relatedTypeSpecProjectFolder": ["specification/deviceregistry/DeviceRegistry.Management"] }Generates command:
tsp-client init ... --emitter-options "api-version=2025-10-01"And displays warning:
This checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines
Testing Guidelines
SDK Generation Guidelines
*.csprojandAssemblyInfo.csfiles have been updated with the new version of the SDK.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.