-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
CodeGenIssues that relate to code generationIssues that relate to code generationbugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
CodeGenIssues that relate to code generationIssues that relate to code generationbugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.
Type
Projects
Status
Untriaged