Open whydoievenneedthis opened 2 years ago
Following the instructions from the documentation: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/templating.md
I got the CLI, created the following config.json file:
{ "generatorName": "typescript-angular", "inputSpec": "spec.json", "outputDir": "gen", "templateDir": "templates", "files": { "AUTHORS.md": {} } }
Created the templates directory, added an empty AUTHORS.md file and executed the following command: openapi-generator-cli generate -c config.json
templates
AUTHORS.md
openapi-generator-cli generate -c config.json
This resulted in the expected generated typescript projet, witht he additional AUTHORS.md file.
Afterwards I tried to make the same change to my gradle configuration:
task("openApiGenerateClient_spec", type: GenerateTask, group: 'openapi subtasks') { generatorName = "typescript-angular" inputSpec = "spec.json" outputDir = "gen" // lines below are newly added templateDir = "templates" files = { AUTHORS.md = {} } }
However, when I now run this task, I get the following error:
> Could not set unknown property 'files' for task ':openApiGenerateClient_spec' of type org.openapitools.generator.gradle.plugin.tasks.GenerateTask.
Which corresponds to the GenerateTask not having a files property: https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt
GenerateTask
files
6.2.0
Is there any progress on this issue?.. i'm also facing this issue
Bug Report Checklist
Description
Following the instructions from the documentation: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/templating.md
I got the CLI, created the following config.json file:
Created the
templates
directory, added an emptyAUTHORS.md
file and executed the following command:openapi-generator-cli generate -c config.json
This resulted in the expected generated typescript projet, witht he additional
AUTHORS.md
file.Afterwards I tried to make the same change to my gradle configuration:
However, when I now run this task, I get the following error:
Which corresponds to the
GenerateTask
not having afiles
property: https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.ktopenapi-generator version
6.2.0