node.js - How to use configuration file (openapitools.json) with NestJs to dynamically configure output directory - Stack Overfl

I use @openapitoolsopenapi-generator-cli to generate models, and I want to configure the output direct

I use @openapitools/openapi-generator-cli to generate models, and I want to configure the output directory dynamically using the format #{ext}/#{name}. However, I am unsure how or where to configure the values for #{ext} and #{name} in NestJS. I have searched through multiple documentation sources but haven't found anything helpful.

{
  "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
  "spaces": 2,
  "generator-cli": {
    "version": "7.9.0",
    "storageDir": "~/my/custom/storage/dir", // optional
    "generators": { // optional
      "v2.0": { // any name you like (just printed to the console log) 
        "generatorName": "typescript-nestjs",
        "output": "#{cwd}/output/v2.0/#{ext}/#{name}",
        "glob": "examples/v2.0/{json,yaml}/*.{json,yaml}",
        "additionalProperties": {
          "ngVersion": "6.1.7",         
          "supportsES6": "true",
          "npmVersion": "6.9.0",
          "withInterfaces": true
        }
      },
      "v3.0": { // any name you like (just printed to the console log) 
        "generatorName": "typescript-fetch",
        "output": "#{cwd}/output/v3.0/#{ext}/#{name}",
        "glob": "examples/v3.0/petstore.{json,yaml}"
      }
    }
  }
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742420961a4440671.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信