Created by: delenius
PR checklist
-
Read the contribution guidelines. -
Ran the shell script under ./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
. -
Filed the PR against the correct branch: Default: master
. -
Copied the technical committee to review the pull request if your PR is targeting a particular programming language.
Description of the PR
- Don't use property initializers
The ES6 Javascript generator used property initializers, as described here.
This is not standard ES6. In particular, create-react-app chokes on it (see this issue, which is fixed by this commit).
This commit instead reverts back to using prototypes, as in the non-es6 JS generator.
- Add missing pom.xml files
This allows us to run mvn integration-test
in these folders.
- Add missing double-quotes around enum field names.
This avoids errors due to fields that contain illegal characters.
- Fix support for multiple inheritance
The previous implementation was broken. I added static "initialize" methods, which supports multiple inheritance.
- Comment out some broken tests.
There were tests for OuterBoolean etc, which are not generated as part of index.js in the generated petstore clients. Hence, these tests threw an error. The actual tests were already commented out anyway. I just commented out one more line to avoid an error.
-
Remove some empty lines in generates JS files.
-
Fixed doubly generated superclass initializer calls.
-
Fixed missing single quotes in returnType in the generated "Api" classes.
The es6 and promise-es6 integration tests now pass (they didn't before).
Furthermore, the generated clients now work with create-react-app (see this open swagger-codegen issue).
Copying JS technical committee: @CodeNinjai @frol @cliffano