swagger-api / swagger-api/swagger-codegen
[CPPREST] Generated code does not compile because of bad characters: {}.[]
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Swagger schema contains definitions like "Org.Forms.{location}.Connect.ProjectSettings". Generated code for such schema contains classes like "class Instance[Org.Forms.{location}.Connect.ProjectSettings]". This is not valid c++ and it does not compile. Is this a bug? Does workaround exist?
Swagger-codegen version
2.4.14
Swagger declaration file content or url
https://www.dropbox.com/s/gec7tj59fuzi44h/bad_swagger_schema.json?dl=1
Command line used for generation
java -jar .\swagger-codegen-cli.jar generate -l cpprest -i .\bad_swagger_schema.json -o .
Steps to reproduce
- Copy schema to c:\test\bad_swagger_schema.json
- Open powershell and go to c:\test
- Run
java -jar .\swagger-codegen-cli.jar generate -l cpprest -i .\bad_swagger_schema.json -o .
Related issues
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 by downloading bad_swagger_schema.json and running the documented Java swagger-codegen command with the cpprest generator. Inspect the generated C++ declarations containing Org.Forms.{location}.Connect.ProjectSettings and the cpprest generator templates or naming entry points that produced them. Done means the generated C++ compiles without invalid characters.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100