karlvr / openapi-generator-plus-generators

Other
21 stars 8 forks source link

typescript-common-generator TypeError #8

Closed jchuahtacc closed 3 years ago

jchuahtacc commented 3 years ago

When running openapi-generator-plus with the following config:

{
    "inputPath": "openapi_v3.yml",
    "outputPath": "tapis-api-types-ogp",
    "generator": "@openapi-generator-plus/typescript-generator-common"
}

on this yml the CLI returns the following error:

Failed to process the API specification: TypeError: state.generator.generatorType is not a function
    at hasNoGenerationRule (/usr/local/lib/node_modules/openapi-generator-plus/node_modules/@openapi-generator-plus/core/dist/process.js:103:43)
    at processCodegenOperation (/usr/local/lib/node_modules/openapi-generator-plus/node_modules/@openapi-generator-plus/core/dist/process.js:85:9)
    at processCodegenOperationGroup (/usr/local/lib/node_modules/openapi-generator-plus/node_modules/@openapi-generator-plus/core/dist/process.js:61:24)
    at processCodegenDocument (/usr/local/lib/node_modules/openapi-generator-plus/node_modules/@openapi-generator-plus/core/dist/process.js:47:9)
    at Object.processDocument (/usr/local/lib/node_modules/openapi-generator-plus/node_modules/@openapi-generator-plus/core/dist/process.js:141:5)
    at Object.createCodegenDocument (/usr/local/lib/node_modules/openapi-generator-plus/node_modules/@openapi-generator-plus/core/dist/index.js:71:22)
    at generate (/usr/local/lib/node_modules/openapi-generator-plus/dist/index.js:25:22)
    at async run (/usr/local/lib/node_modules/openapi-generator-plus/dist/index.js:136:18)
karlvr commented 3 years ago

@jchuahtacc thanks for reporting this issue. It sounds a little bit like the versions of the generator core vs generator are out of step. Could you please check which versions you're using and perhaps upgrade to the latest versions of each?

e.g.

npx npm-check-updates

then

npx npm-check-updates -u