swagger-api / swagger-api/swagger-codegen-generators
[JAVA/okhttp-json] some errors in api.mustache template in relation to localVariablePrefix
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 299
- Forks
- 439
- PR merge metrics
- No merged PRs in 30d
Description
Description
There are a few unresolved variables in the api.mustache template:
callback should NOT have prefix since it is not a local variable:
https://github.com/swagger-api/swagger-codegen-generators/blob/245e0738ed443b08fdb2a1ad719ddb6d55716b8b/src/main/resources/handlebars/Java/libraries/okhttp-gson/api.mustache#L210-L247
apiClient is missing prefix here:
https://github.com/swagger-api/swagger-codegen-generators/blob/245e0738ed443b08fdb2a1ad719ddb6d55716b8b/src/main/resources/handlebars/Java/libraries/okhttp-gson/api.mustache#L116
Suggest a fix/enhancement
I fixed the template locally. Will make a PR.
Version 2 issue: https://github.com/swagger-api/swagger-codegen/issues/10351
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 with src/main/resources/handlebars/Java/libraries/okhttp-gson/api.mustache, especially the referenced lines around 116 and 210-247. Compare each use of localVariablePrefix with whether the variable is local, then verify the generated Java API template output and check the related version 2 issue for context.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100