You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Download https://digital.nhs.uk/restapi/oas/357490 to 357490.json
var fs = require('fs');
var CodeGen = require('swagger-js-codegen').CodeGen;
var file = '357490.json';
var swagger = JSON.parse(fs.readFileSync(file, 'UTF-8'));
console.log(swagger )
var nodejsSourceCode = CodeGen.getNodeCode({ className: 'Test', swagger: swagger });
console.log(nodejsSourceCode )
Just says
/home/tchiverton/workspace/swagger-js-codegen/node_modules/swagger-js-codegen/lib/codegen.js:221
swagger.apis.forEach(function(api){
^
TypeError: Cannot read properties of undefined (reading 'forEach')
at getViewForSwagger1 (/home/tchiverton/workspace/swagger-js-codegen/node_modules/swagger-js-codegen/lib/codegen.js:221:18)
at getCode (/home/tchiverton/workspace/swagger-js-codegen/node_modules/swagger-js-codegen/lib/codegen.js:277:82)
at Object.getNodeCode (/home/tchiverton/workspace/swagger-js-codegen/node_modules/swagger-js-codegen/lib/codegen.js:344:16)
at Object.<anonymous> (/home/tchiverton/workspace/swagger-js-codegen/make.js:7:32)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47
The text was updated successfully, but these errors were encountered:
Download
https://digital.nhs.uk/restapi/oas/357490
to 357490.jsonJust says
The text was updated successfully, but these errors were encountered: