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

[cli] Full config help details

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Jim Schubert requested to merge full-config-help-details into master Jan 05, 2020
  • Overview 0
  • Commits 2
  • Pipelines 0
  • Changes 1

Extends the config-help command for formatted output of things like instantiation type mappings, import mappings, etc. Not included here is supporting files because these are almost always set at processOpts time, meaning we'd need to have a dry-run option on the generate command for those outputs.

I haven't enabled the outputs by default. Looking for contributor feedback first. I think this would be an excellent addition to the generator docs that we auto-generate.

Adds boolean options for which output user is looking for, including a full-details option for all.

NAME
        openapi-generator-cli config-help - Config help for chosen lang

SYNOPSIS
        openapi-generator-cli config-help
                [(-f <output format> | --format <output format>)] [--full-details]
                [(-g <generator name> | --generator-name <generator name>)]
                [--import-mappings] [--instantiation-types]
                [--language-specific-primitive] [--markdown-header] [--named-header]
                [(-o <output location> | --output <output location>)] [--reserved-words]

OPTIONS
        -f <output format>, --format <output format>
            Write output files in the desired format. Options are 'text',
            'markdown' or 'yamlsample'. Default is 'text'.

        --full-details
            displays CLI options as well as other configs/mappings (implies
            --instantiation-types, --reserved-words,
            --language-specific-primitives, --import-mappings,
            --supporting-files)

        -g <generator name>, --generator-name <generator name>
            generator to get config help for

        --import-mappings
            displays the default import mappings (types and aliases, and what
            imports they will pull into the template)

        --instantiation-types
            displays types used to instantiate simple type/alias names

        --language-specific-primitive
            displays the language specific primitives (types which require no
            additional imports, or which may conflict with user defined model
            names)

        --markdown-header
            When format=markdown, include this option to write out markdown
            headers (e.g. for docusaurus).

        --named-header
            Header includes the generator name, for clarity in output

        -o <output location>, --output <output location>
            Optionally write help to this location, otherwise default is
            standard output

        --reserved-words
            displays the reserved words which may result in renamed model or
            property names

Plain text output example

image

Formatted markdown output example

image

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

cc @OpenAPITools/generator-core-team

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: full-config-help-details