Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Merge requests
  • !180

Various fixes for JS (ES6) generator

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/delenius/feature/es6-fixes into master May 30, 2018
  • Overview 0
  • Commits 6
  • Pipelines 0
  • Changes 194

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

  1. 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.

  1. Add missing pom.xml files

This allows us to run mvn integration-test in these folders.

  1. Add missing double-quotes around enum field names.

This avoids errors due to fields that contain illegal characters.

  1. Fix support for multiple inheritance

The previous implementation was broken. I added static "initialize" methods, which supports multiple inheritance.

  1. 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.

  1. Remove some empty lines in generates JS files.

  2. Fixed doubly generated superclass initializer calls.

  3. 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

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/delenius/feature/es6-fixes