-
Notifications
You must be signed in to change notification settings - Fork 215
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
http-client-java, accessor to subclient #5027
base: main
Are you sure you want to change the base?
http-client-java, accessor to subclient #5027
Conversation
No changes needing a change description found. |
const subClients = this.listSubClientsUnderClient(client, !enableSubclient); | ||
if (enableSubclient) { | ||
// subclient, no operation group | ||
for (const subClient of subClients) { | ||
const codeModelSubclient = this.processClient(subClient); | ||
codeModelClient.addSubClient(codeModelSubclient); | ||
} | ||
} else { |
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.
Most is refactor (extract code to processClient
, as we now need to call it recursively).
Here is the main change, with the option, we would not do operation group, and every client is a client (or subclient).
} | ||
|
||
private listSubClientsUnderClient( | ||
client: SdkClientType<SdkHttpOperation>, | ||
includeNestedOperationGroups: boolean, | ||
isRootClient: boolean, |
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.
This isRootClient
param seems not needed. If a client does not have parent, it is the root client.
You can try these changes here
|
@@ -90,6 +92,8 @@ const EmitterOptionsSchema: JSONSchemaType<EmitterOptions> = { | |||
|
|||
"group-etag-headers": { type: "boolean", nullable: true }, | |||
|
|||
"enable-subclient": { type: "boolean", nullable: true, default: false }, |
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.
Do we want to set the option to true in our test to see the impact? (at least for some of the tests)
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.
Yes, we'd plan to set it to true for the subclient related tests (and for the whole unbranded too, if we separate the flavors).
Currently my cadl-ranch PR is not merged, so we don't have them now. (test case, the basic one, is written before the http-specs package, I would need to migrate it first; and we will need more tests on advanced cases)
…entAccessorMethod more consistent with ClientMethod
Link Azure/autorest.java#2972
Current limitation
Feature behind
enable-subclient
option (false
means client/operationGroup;true
means all client, with client having accessor to get subclient)unbranded openai https://github.com/joseharriaga/openai-in-typespec
Bug to be fixed in other PRs (relate to unbranded openai, but unrelated to this feature -- moved to #5047)
Test