Skip to content

Use method param data as source of truth#879

Merged
jhendrixMSFT merged 2 commits intoAzure:mainfrom
jhendrixMSFT:method-params
Feb 26, 2026
Merged

Use method param data as source of truth#879
jhendrixMSFT merged 2 commits intoAzure:mainfrom
jhendrixMSFT:method-params

Conversation

@jhendrixMSFT
Copy link
Copy Markdown
Member

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.

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.
Copilot AI review requested due to automatic review settings February 26, 2026 17:01
Comment thread packages/typespec-rust/src/tcgcadapter/adapter.ts
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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 adaptMethodParameter to accept an optional methodParam parameter and use it as the source of truth for parameter optionality, type, and documentation
  • Updated KeyVault Secrets TypeSpec to add "!rust" filter to @@override decorators, preserving existing Rust behavior
  • Generated code reflects the new parameter handling, correctly including the out_content_type query 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

Copy link
Copy Markdown
Member

@heaths heaths left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jhendrixMSFT jhendrixMSFT merged commit f380f82 into Azure:main Feb 26, 2026
5 checks passed
@jhendrixMSFT jhendrixMSFT deleted the method-params branch February 26, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants