OpenAPITools / OpenAPITools/openapi-generator-cli

[Question] How are placeholders passed to config?

Open
#645 0 comments 1 reaction 1 assignee View on GitHub

@kay-schecker is already working on this.

Since Apr 27, 2022.

bug
Dominant language
TypeScript
Stars
2k
Forks
208
Avg merge
7h 12m
Merged PRs (30d)
6

Description

Hi.

When using config via openapitools.json, the documentation states that placeholders are in use, e.g for. cwd and name:

{
  "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
  "spaces": 2,
  "generator-cli": {
    "version": "5.1.1",
    "generators": { // optional
      "my-generator": 
        "generatorName": "typescript-angular",
         "inputSpec": "#{cwd}/specs/${name}.json",
        "output": "#{cwd}/output/#{name}",
      }
    }
  }
}

My question is how do I pass the placeholders in the command? Ive tried

yarn run openapi-generator-cli generate --generator-key my-generator --name my-spec, but the name property doesnt get through to the generator:

[error] The spec file is not found: {..this path is correct (cwd)....}/specs/.json <---- name is missing

I could use something like envsubst, but that seems unnecessary?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.