-
Notifications
You must be signed in to change notification settings - Fork 299
http-client-java, bug fix on enum variable name #7590
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, bug fix on enum variable name #7590
Conversation
No changes needing a change description found. |
...ore/src/test/java/com/microsoft/typespec/http/client/generator/core/util/CodeNamerTests.java
Show resolved
Hide resolved
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.
Pull Request Overview
This PR addresses a bugfix in the enum member name generation for the HTTP client Java generator. Key changes include:
- Updating unit tests in CodeNamerTests.java to validate new naming outcomes for various inputs.
- Refactoring CodeNamer.java to remove redundant special-case handling and adding a new helper method (trimUnderscores) for cleaning leading/trailing underscores.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
CodeNamerTests.java | Updated and added test cases to verify the enum member naming logic, including handling of numeric and special character inputs |
CodeNamer.java | Removed outdated special-case logic and added trimming reprocessing to better handle underscore-only inputs and special character scenarios |
Comments suppressed due to low confidence (1)
packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/util/CodeNamer.java:150
- While handling the case where the result is an underscore, consider adding tests for inputs that yield multiple underscores or an empty string after trimming to ensure consistent behavior.
if (result.equals("_")) {
...tor-core/src/main/java/com/microsoft/typespec/http/client/generator/core/util/CodeNamer.java
Show resolved
Hide resolved
d4c6b9a
to
7b0271a
Compare
You can try these changes here
|
follow up on #7448