Skip to content

[Question] How are placeholders passed to config? #645

Open
@stianmorsund

Description

@stianmorsund

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?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions