swagger-api / swagger-api/swagger-codegen
[JavaScript][ES6] Incorrect content in the generated README.md
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
-
When generating the SDK with configuration file
js-config.jsonwithuseES6set to true:{ "useES6" : true }The
README.mdin the generated package contains code examples that is still inES5. i.e.var coolAPI = require('cool_api'); var api = new coolApi.ModuleFooApi() ...which should be:
import coolAPI from 'cool_api'; let apiInstance = new coolApi.ModuleFooApi(); ... -
Also the
Local developmentsection that used to be in the ES5 SDK is also missing from the ES6 SDK. Perhaps thenpm linkinstructions would still be useful?
Swagger-codegen version
| Q | A |
|---|---|
| Which Java version? | Java(TM) SE Runtime Environment (build 1.8.0_162-b12) |
| Which swagger-codegen used? | swagger-codegen-cli-2.3.1.jar |
Command line used for generation
java -jar swagger-codegen-cli-2.3.1.jar generate -i api-spec.json -l javascript -o ./js-sdk -c js-config.json
Other Observations
This issue seems only have impacted the README.md that exist at the root folder of the generated package. All other *.md files under /docs folder were generated with the correct example in ES6 syntax.
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
Reproduce the JavaScript SDK with the shown swagger-codegen command and js-config.json using useES6=true. Compare the generated root README.md with the correctly formatted markdown under /docs; done means the README uses ES6 examples and restores the Local development/npm link guidance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100