[Storage] Support fine-grained parameter augmentation in `client.tsp`
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start by reading the repeated overrides in the Storage Blob client.tsp and compare them with the base definitions in routes.tsp. Investigate how parameter-level augmentation could replace the six full operation clones, including optionality changes and omitted request parameters. Done means these deltas can be expressed without redefining routes, responses, or unrelated parameters.
Written by the indexing model from the issue text.
Description
Motivation / Current State
@@override is the only tool available when the change touches an operation's parameter list, and it is an all-or-nothing replacement:
- Full clones for tiny changes. To change one parameter we must copy the operation's complete signature. The single intended edit is buried in a large duplicate.
- Risk of definition drift. The override is a static snapshot. When the base operation changes (new parameter, new response header, route change, new API version), the override silently goes stale and must be kept in sync by hand. Nothing enforces parity.
- Repeated across many operations. In a single service
client.tspthis pattern recurs for numerous operations, each a large clone that exists to change one small thing. - Duplicated suppressions. Any suppressions applied to the definition in
routes.tspmust be restated here.
Concrete example
In the Storage Blob client.tsp, making the metadata header required for Rust on container setMetadata requires a full operation redefinition.
alias MetadataHeadersRequired = {
/** The metadata headers. */
@alternateType(Record<string>, "rust")
@header("x-ms-meta")
metadata: string; // <-- the ONLY intended change vs. the base op, now required dropping the '?'
};
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Existing API"
#suppress "@azure-tools/typespec-azure-core/no-response-body" "Existing API"
#suppress "@azure-tools/typespec-azure-core/use-standard-names" "Existing API"
@put
@sharedRoute
@route("?restype=container&comp=metadata")
op setMetadataRequiredMetadataContainer is StorageOperationNoBody<
{
...TimeoutParameter;
...LeaseIdOptionalParameter;
...MetadataHeadersRequired;
...IfModifiedSinceParameter;
},
{
...EtagResponseHeaderPrivate;
...LastModifiedResponseHeaderPrivate;
}
>;
@@override(Container.setMetadata, setMetadataRequiredMetadataContainer, "rust");
This is not a one-off
The same shape repeats throughout this single file: each a full operation clone whose only real purpose is a one-parameter delta:
setMetadataRequiredMetadataContainer(containersetMetadata, Rust): making themetadataheader required instead of optional (metadata?→metadata).setMetadataRequiredMetadataBlob(blobsetMetadata, Rust): same as abovesetAccessPolicyRequiredContainerAcl(containersetAccessPolicy, Rust):containerAclrequest body required instead of optional.appendBlockNoStructuredMessage(appendappendBlock, Rust): omitting the structured-message parameters (not yet implemented) from the request.stageBlockNoStructuredMessage(blockstageBlock, Rust): same as aboveuploadPagesNoStructuredMessage(pageuploadPages, Rust): same as above
Why every one of these requires a full clone today
All six deltas are parameter-level edits- flip one parameter's optionality or drop a couple of parameters from the request. None of them touch the route, the response shape, or the rest of the parameter list. Yet each currently require a full redefinition of 99% the same functionality but augmenting a handful of parameters. This also, as mentioned above, become a maintenance nightmare given that these are handwritten and must be maintained alongside the actual routes.tsp definition.
- 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