OpenAPITools / OpenAPITools/openapi-generator
[BUG][Kotlin]Different styles of class variable names
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
@jimschubert @dr4ke616 @karismann @Zomzog @andrewemery @4brunu
What result shoud be when you pass var name 111 or 111name?
By according this comment I think it should be escaped `111` and `111name` but this class and method are full of bugs and result of toVarName() is _111 and `111name`. As for me it's different strange behavior. As for Kotlin it's acceptable. But I want to make some refactor of this class and I need approve of result.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java, especially the comment around line 869, the class setup near line 42, and toVarName() near line 835. Confirm the intended results for 111 and 111name with maintainers before refactoring; done means the naming behavior and expected escaping are agreed and consistently covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, kotlin
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100