Use method param data as source of truth#879
Merged
jhendrixMSFT merged 2 commits intoAzure:mainfrom Feb 26, 2026
Merged
Conversation
Only use values from the operation param data that aren't captured in the method param data (e.g. header/path/query type etc). Update KV tsp to preserve existing behavior.
jhendrixMSFT
commented
Feb 26, 2026
jhendrixMSFT
commented
Feb 26, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request updates the parameter handling logic in the TypeSpec Rust code generator to use method parameter data as the source of truth instead of operation parameter data. This ensures that parameter attributes like optionality and type are correctly derived from method-level overrides rather than the base operation definition.
Changes:
- Modified
adaptMethodParameterto accept an optionalmethodParamparameter and use it as the source of truth for parameter optionality, type, and documentation - Updated KeyVault Secrets TypeSpec to add
"!rust"filter to@@overridedecorators, preserving existing Rust behavior - Generated code reflects the new parameter handling, correctly including the
out_content_typequery parameter for KeyVault secrets
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/typespec-rust/src/tcgcadapter/adapter.ts | Core logic change to adaptMethodParameter to use methodParam as source of truth for optionality, type, and docs |
| packages/typespec-rust/test/tsp/Security.KeyVault.Secrets/client.tsp | Added "!rust" filter to @@OverRide decorators to preserve existing Rust behavior |
| packages/typespec-rust/test/sdk/keyvault_secrets/src/generated/models/method_options.rs | Added out_content_type field to SecretClientGetSecretOptions |
| packages/typespec-rust/test/sdk/keyvault_secrets/src/generated/clients/secret_client.rs | Added query parameter handling for out_content_type |
| packages/typespec-rust/package.json | Version bump to 0.36.0 |
| packages/typespec-rust/CHANGELOG.md | Added release notes for 0.36.0 |
heaths
approved these changes
Feb 26, 2026
Member
heaths
left a comment
There was a problem hiding this comment.
Is the only reason I don't see Storage changes in here is because we need to make those yet? The KV changes make sense (see other comments) and I'm fixing those in the specs repo now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Only use values from the operation param data that aren't captured in the method param data (e.g. header/path/query type etc). Update KV tsp to preserve existing behavior.