Skip to content

[http-client-java] mgmt premium, fix sample entry point and serviceClient reference for autorest#10082

Open
XiaofeiCao wants to merge 4 commits intomainfrom
java_mgmt_premium_sample_service_client
Open

[http-client-java] mgmt premium, fix sample entry point and serviceClient reference for autorest#10082
XiaofeiCao wants to merge 4 commits intomainfrom
java_mgmt_premium_sample_service_client

Conversation

@XiaofeiCao
Copy link
Member

@XiaofeiCao XiaofeiCao commented Mar 19, 2026

Bug

When generating premium mgmt samples from Swagger, we switched to use individual entry points in #9845. However, for multi-service scenario(appservice, resources, etc)

  1. entry point now be the aggregated Manager, instead of the individual packages, e.g. There's no PolicyManager, but rather ResourceManager.
  2. service client got separate too, instead of residing inside of the entry Manager. e.g. There's no ResourceManager.serviceClient().getPolicyDefinitions(), but rather ResourceManager.policyClient().getPolicyDefinitions().

Solution

We'll need
For 1. Add service-name config to api-specs.json, to allow for entry point discovery. E.g. ResourceManager instead of default PolicyManager. PR: Azure/azure-sdk-for-java#48490
For 2. We need secondary service client entry mapping. Fortunately, we already have metadata-suffix that we can use:
E.g. https://github.com/Azure/azure-sdk-for-java/blob/16fffda39d14c6fc6f3f24a972814c429d46c135/sdk/resourcemanager/api-specs.json#L18

Limitation

The fix is mainly for Swagger purpose. Might need a revisit for TypeSpec multi-service.
Will log an issue if we take this approach.

About this PR

@microsoft-github-policy-service microsoft-github-policy-service bot added the emitter:client:java Issue for the Java client emitter: @typespec/http-client-java label Mar 19, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 19, 2026

All changed packages have been documented.

  • @typespec/http-client-java
Show changes

@typespec/http-client-java - fix ✏️

mgmt premium, fix sample entry point and serviceClient reference

@azure-sdk
Copy link
Collaborator

azure-sdk commented Mar 19, 2026

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

XiaofeiCao and others added 3 commits March 20, 2026 12:39
@XiaofeiCao XiaofeiCao changed the title WIP, [http-client-java] mgmt premium, fix sample entry point and serviceClient reference [http-client-java] mgmt premium, fix sample entry point and serviceClient reference Mar 20, 2026
@XiaofeiCao XiaofeiCao marked this pull request as ready for review March 20, 2026 06:26
@XiaofeiCao XiaofeiCao changed the title [http-client-java] mgmt premium, fix sample entry point and serviceClient reference [http-client-java] mgmt premium, fix sample entry point and serviceClient reference for autorest Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:java Issue for the Java client emitter: @typespec/http-client-java

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants