Skip to content

http-client-java, bug fix on parent resource rename#8190

Merged
weidongxu-microsoft merged 2 commits intomicrosoft:mainfrom
weidongxu-microsoft:http-client-java_bug-fix
Aug 14, 2025
Merged

http-client-java, bug fix on parent resource rename#8190
weidongxu-microsoft merged 2 commits intomicrosoft:mainfrom
weidongxu-microsoft:http-client-java_bug-fix

Conversation

@weidongxu-microsoft
Copy link
Contributor

@weidongxu-microsoft weidongxu-microsoft commented Aug 14, 2025

fix problem caused by #8176

It causes problem on ExtensionResource, that systemData is not included in the result resource. However it is not reproducible from azure-http-specs test.

The current solution is to limit this rename to AutoGenerated class alone.

@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 Aug 14, 2025
@github-actions
Copy link
Contributor

No changes needing a change description found.

@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@XiaofeiCao
Copy link
Member

What's the issue with ExtensionResource?

@weidongxu-microsoft weidongxu-microsoft added this pull request to the merge queue Aug 14, 2025
@weidongxu-microsoft
Copy link
Contributor Author

weidongxu-microsoft commented Aug 14, 2025

What's the issue with ExtensionResource?

The systemData is not generated in the resource model.
https://github.com/Azure/azure-sdk-for-java/pull/46397/files#diff-0e5be5ec57a2461a9144e5985ad6526bd1137653c8210f20141b856143e3ac31
image

To be frank, I still not sure what happened. It seems related to the rename process, as we map ExtensionResource to ProxyResource in codegen.
https://github.com/microsoft/typespec/blob/main/packages/http-client-java/generator/http-client-generator-mgmt/src/main/java/com/microsoft/typespec/http/client/generator/mgmt/transformer/ResourceTypeNormalization.java#L251-L252

Also, there is a "replace parent" logic, when name is not same.
https://github.com/microsoft/typespec/blob/main/packages/http-client-java/generator/http-client-generator-mgmt/src/main/java/com/microsoft/typespec/http/client/generator/mgmt/transformer/ResourceTypeNormalization.java#L339-L359

However, I still unsure why these causes this missing of systemData.
Here, the current fix is just limit the scope of my previous rename, so basically it only handle ##AutoGenerated# class.

Let me know if you think up something.

Merged via the queue into microsoft:main with commit 48315fe Aug 14, 2025
26 checks passed
@weidongxu-microsoft weidongxu-microsoft deleted the http-client-java_bug-fix branch August 14, 2025 09:46
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.

4 participants