-
Notifications
You must be signed in to change notification settings - Fork 41
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] add @clientInitialization
decorator
#1398
Conversation
All changed packages have been documented.
Show changes
|
You can try these changes here
|
…dd_client_initialization
…dd_client_initialization
packages/typespec-client-generator-core/test/decorators.test.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
three concerns:
- can we have a test with
@client
and@operationGroup
? - i'm wondering if we need to add a lint to disallow promoting method param to client if it is not in all client's operation?
- with this decorator, is it possible to remove the hard code for promoting
subscriptionId
cause it is not already client parameter in brownfield?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the parameter blobName
is bumped to client-level, there will no blobName
in method (SdkMethod), but it will still in Operation (method.Operation). Right?
But we need to know that blobName
is bumped to client-level, so that when we handle this parameter we will find it in Client. It is better to have a flag to indicate that the operation parameter is moved to client, such as Location="client"
@chunyu3 it will have property |
packages/typespec-client-generator-core/test/decorators.test.ts
Outdated
Show resolved
Hide resolved
packages/typespec-client-generator-core/generated-defs/Azure.ClientGenerator.Core.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, having a few query though.
packages/typespec-client-generator-core/test/decorators.test.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add a test of redefining the client hierarchy in client.tsp and then add @clientInitialization
to the new defined client? it seems will work well from the code logic, but i'm not sure if there is any corner case.
packages/typespec-client-generator-core/generated-defs/Azure.ClientGenerator.Core.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall lgtm. one thing is could you also check if we could solve this: #1391 in this pr?
fixes Azure#914 --------- Co-authored-by: iscai-msft <[email protected]>
fixes #914