OpenAPITools / OpenAPITools/openapi-generator
[BUG] [typescript-axios]
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
My question is: when I use -t xxxx and -c xxxin the same command, the template is not efffective.
The steps are as follows:
In my project, I install @openapitools/openapi-generator-cli dependence.
the content of configuration file openapitools.jsonis:
{
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "6.6.0",
"generators": {
"v2.0": {
"generatorName": "typescript-axios",
"output": "./api",
"inputSpec": "./json/api.json",
"templateDir": "./template",
"additionalProperties": {
"apiPackage": "api",
"modelPackage": "interface",
"withSeparateModelsAndApi": true,
"withInterfaces": true,
"supportsES6": true
}
}
}
}
}
the command is: npx openapi-generator-cli generate -c ./openapitools.json --generator-key v2.0.
the template can be used normally.
when I change the command: npx openapi-generator-cli generate -c ./openapitools.json --generator-key v2.0 -t /Users/wutao/Desktop/demo/generate-api/template, and delete the templateDir properties of the configuration file, the templatefiles are not efffective.
Is there any kind person who can help me tell me the reason for this
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with openapitools.json and the template directory, then run the two provided npx openapi-generator-cli commands using the typescript-axios generator. Compare the effects of templateDir and the -t option, and verify the generated files to determine why the custom templates are not applied.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, openapi, typescript
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100