http-client-java, support exact in clientName#10758
Open
weidongxu-microsoft wants to merge 9 commits into
Open
http-client-java, support exact in clientName#10758weidongxu-microsoft wants to merge 9 commits into
weidongxu-microsoft wants to merge 9 commits into
Conversation
Contributor
|
All changed packages have been documented.
|
|
You can try these changes here
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for preserving “exact” names coming from TCGC in the Java HTTP client generator, ensuring the preprocessor doesn’t re-normalize names that were explicitly provided by the emitter.
Changes:
- Preserve pre-set
language.java.namevalues during the Java preprocessor rename pass (only generate a name when the Java name is missing/empty). - Populate
language.java.namein the Java emitter whenisExactNameis set (parameters, headers, schemas, properties). - Add a Chronus changelog entry for
@typespec/http-client-java.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/preprocessor/tranformer/Transformer.java | Avoids overwriting existing Java names during rename transformations. |
| packages/http-client-java/emitter/src/code-model-builder.ts | Sets Java names for “exact name” cases while building the code model. |
| .chronus/changes/http-client-java_support-exact-2026-4-21-17-10-37.md | Changelog entry documenting the feature. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix Azure/autorest.java#3340
manual tested on https://github.com/Azure/typespec-azure/blob/main/packages/azure-http-specs/specs/azure/client-generator-core/exact-name/main.tsp
need its release to write e2e
Impl is relatively simple. If
isExactName, set the name directly tolanguage.java.name. And later in Java code this name will not get transformed (otherwise, Java code will do a transform fromlanguage.default.nametolanguage.java.name).It is not complete though. There is
isExactNamemissing from some types. TCGC fixed but not released.Azure/typespec-azure#4480