Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tcgc] support multiple alias for a parameter via @paramAlias #1893

Open
chunyu3 opened this issue Nov 20, 2024 · 0 comments
Open

[tcgc] support multiple alias for a parameter via @paramAlias #1893

chunyu3 opened this issue Nov 20, 2024 · 0 comments
Labels
lib:tcgc Issues for @azure-tools/typespec-client-generator-core library

Comments

@chunyu3
Copy link
Member

chunyu3 commented Nov 20, 2024

It is common that a property/parameter has more than one alias. But now when we use @paramAlias to define multiple parameter alias, it will only accept one alias (the first line).

// main.tsp
namespace My.Service;

op upload(blobName: string): void;
op download(blobName: string): void;
op theName(bName: string): void;

// client.tsp
import "@azure-tools/typespec-client-generator-core";
using Azure.ClientGenerator.Core;

namespace My.Customizations;

model ClientInitOptions {
  blobClientName: string;
}
@@clientInitialization(MyService, ClientInitOptions)
@@paramAlias(ClientInitOptions.blobClientName, "blobName");
@@paramAlias(ClientInitOptions.blobClientName, "bName")

We need to support a parameter will have multiple alias.
In above scenario, ClientInitOptions.blobClientName has two alias, and both parameter blobName in upload/download operation and bName in theName operation will be bumped to client level.

@chunyu3 chunyu3 added the lib:tcgc Issues for @azure-tools/typespec-client-generator-core library label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib:tcgc Issues for @azure-tools/typespec-client-generator-core library
Projects
None yet
Development

No branches or pull requests

1 participant