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
  • !57

Cli generator name option, replaces 'language' options in CLI and Maven Plugin

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Jim Schubert requested to merge github/fork/jimschubert/cli-generator-name-option into master May 16, 2018
  • Overview 0
  • Commits 17
  • Pipelines 0
  • Changes 423

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

The language option (--lang and -l in CLI, language in maven plugin) has drifted from the original intention of defining a top-level language implementation with variance on library. Generators began to encode generator type into language (e.g. erlang-client), reused language as framework-only (e.g. scalatra), or embedded language and framework (e.g. typescript-angular).

With the 3.0.0 release of openapi-generator, we've moved to a standardization of these names, which means they no longer fit into the singular concept of a "language".

We've discussed plans to provide a better user experience around the CLI, breaking apart the generator lookup into the variations that make up a generator:

  • language
  • type
  • framework
  • version?

To do this, we must first deprecate language and warn users that what they're currently using (e.g. scalatra, typescript-angular) is being replaced by generatorName and that language may mean something else in a later version of the generator.

For discussion, see #39 (closed).

Example usage of the maven plugin is explained in the commit message for e97736f3. You must first run mvn clean package install to stage the 3.0.0-SNAPSHOT from this branch into your local repository. Then, navigate to modules/openapi-generator-maven-plugin/examples and run:

mvn -f non-java.xml compile

This will create an aspnetcore generated example under target/generated-sources/.

Warning messages introduced in this PR will look like (maven plugin output):

$ mvn -f non-java.xml compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sample-project 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- openapi-generator-maven-plugin:3.0.0-SNAPSHOT:generate (default) @ sample-project ---
[WARNING] The 'language' option is deprecated and may reference language names only in the next major release (4.0). Please use 'generatorName' instead.
[WARNING] Output directory does not exist, or is inaccessible. No file (.openapi-generator-ignore) will be evaluated.
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/jimschubert/cli-generator-name-option