Codegen does not implement @clientDefaultValue decorator
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start in the affected test crate, test/spector/azure/client-generator-core/client-default-value, and read the integration test file, including the tests disabled with #[ignore]. Trace the generated options, model defaults, and client-method behavior from those tests; done means the ignored scenarios pass without callers manually supplying the declared defaults.
Written by the indexing model from the issue text.
Description
Summary
The Rust emitter does not implement the @clientDefaultValue TypeSpec decorator. Parameters and model properties annotated with @clientDefaultValue are generated as plain Option<T> fields with no default values applied.
Expected behavior
- Options structs: Fields with
@clientDefaultValueshould have their defaults pre-populated in the Default trait implementation. - Model structs: Fields with
@clientDefaultValue(e.g. retry, tier, timeout on ModelWithDefaultValues) should be pre-populated with their default values in the Default impl. - Client methods: When the user does not provide a value, the generated client should automatically apply the declared default before sending the request.
Actual behavior
All @clientDefaultValue fields are generated as Option<T> defaulting to None. Callers must manually provide the default values.
Affected crate
test/spector/azure/client-generator-core/client-default-value
Test impact
Several integration tests in this crate have been disabled with #[ignore] because they were working around this limitation by manually providing default values. See the test file for details.
- Dominant language
- Rust
- Stars
- 7
- Forks
- 11
- Avg merge
- 14h 15m
- Merged PRs (30d)
- 6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/typespec-rust
-
CodeGen rust
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Azure/typespec-rust#959 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 64/100
Azure/typespec-rust#1032 ·
-
CodeGen
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Azure/typespec-rust#1029 ·
-
CodeGen
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Azure/typespec-rust#1028 ·
-
CodeGen
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Azure/typespec-rust#1020 ·
All issues in Azure/typespec-rust
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100