swagger-api / swagger-api/swagger-codegen
[Kotlin] Parse @JsonProperty annotation values with spaces
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Issue:
When generating a client in Kotlin (from a Kotlin project), @JsonProperty annotation values which have spaces in them are converted to variable names with spaces.
Example:
In project:
@JsonProperty("email address")
val email: String
Result in client:
val email address: String
This of course causes a build failure and thus the only solution at the moment is to not use values with spaces.
Possible solutions:
- Kotlin does allow for variable and method name declarations with spaces.
For example,val `email address`: String - The space could be replaced with an underscore
- The name could be parsed to form a word in camelCase (starting with a lower case letter).
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
No files or tests are named. Start by locating the Kotlin client generator and the handling of JsonProperty values, then reproduce the example with the value "email address". Done means the generated client uses a valid Kotlin declaration and includes a regression test for spaced annotation values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100