swagger-api / swagger-api/swagger-codegen
Apex generator = "currency" is also a reserved word
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Hello,
swagger-codegen is a great tool.
I have used "currency" as a property name and it is not detected as a reserved word (neither present in this official list: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_reserved_words.htm )
Swagger-codegen version
2.4.5
Swagger declaration file content or url
"Price": {
"type": "object",
"properties": {
"totalPrice": { "type": "number" },
"currency": {"type": "string" }
}
},
Command line used for generation
java -jar swagger-codegen-cli-2.4.5.jar generate -i source/swagger.json -l apex -o c:\swagger\generated
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
"currency" is not in the list of reserved words for apex:
Best regards
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/swagger-codegen/src/main/java/io/swagger/codegen/languages/ApexClientCodegen.java and inspect the Apex reserved-word handling for generated properties. Reproduce with the provided Swagger declaration and Java CLI command, then verify that a property named "currency" is handled correctly in the generated Apex output.
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
- 45/100