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

http-client-java, fix corner case that reserved keyword renamed differently #6218

Conversation

weidongxu-microsoft
Copy link
Contributor

@weidongxu-microsoft weidongxu-microsoft commented Mar 3, 2025

On param, float be renamed floatParameter, while on model property, it be renamed floatProperty.
The old mapping logic in ClientMethodMapper failed to handle this corner case.

Add a fallback logic in ClientMethodMapper.
Also updated Transformer, to rename properties for GroupSchema differently (as it groups method parameters).

autorest.java Azure/autorest.java#3034

@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 3, 2025
@azure-sdk
Copy link
Collaborator

azure-sdk commented Mar 3, 2025

❌ There is undocummented changes. Run chronus add to add a changeset or click here.

The following packages have changes but are not documented.

  • @typespec/http-client-java
Show changes

@azure-sdk
Copy link
Collaborator

azure-sdk commented Mar 3, 2025

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@weidongxu-microsoft weidongxu-microsoft marked this pull request as ready for review March 4, 2025 02:35
@XiaofeiCao
Copy link
Member

Wonder what's the corner case here. Would you help add a test case?

@weidongxu-microsoft weidongxu-microsoft changed the title http-client-java, fix corner case that reserved name renamed differently http-client-java, fix corner case that reserved keyword renamed differently Mar 4, 2025
@weidongxu-microsoft
Copy link
Contributor Author

weidongxu-microsoft commented Mar 4, 2025

Wonder what's the corner case here. Would you help add a test case?

Test added e1efcb4

The failure in nightly build was casued by the @clientName not having effect on the above float, in some dev version. This problem seems gone today.

@weidongxu-microsoft weidongxu-microsoft added this pull request to the merge queue Mar 4, 2025
Merged via the queue into microsoft:main with commit 4dfb932 Mar 4, 2025
26 checks passed
@weidongxu-microsoft weidongxu-microsoft deleted the http-client-java_handle-deprecation branch March 4, 2025 04:40
weidongxu-microsoft added a commit to Azure/autorest.java that referenced this pull request Mar 4, 2025
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.

3 participants