apib2swagger
apib2swagger copied to clipboard
Crash with .length of undefined
TypeError: Cannot read property 'length' of undefined
at convertMsonToJsonSchema (/usr/local/lib/node_modules/apib2swagger/src/mson_to_json_schema.js:30:38)
at /usr/local/lib/node_modules/apib2swagger/index.js:47:67
at Array.forEach (<anonymous>)
at /usr/local/lib/node_modules/apib2swagger/index.js:38:26
at Array.forEach (<anonymous>)
at module.exports.convertParsed (/usr/local/lib/node_modules/apib2swagger/index.js:33:8)
at Object.exports.convert (/usr/local/lib/node_modules/apib2swagger/index.js:374:23)
at processBlueprint (/usr/local/lib/node_modules/apib2swagger/bin/apib2swagger.js:87:18)
at ReadStream.on.on (/usr/local/lib/node_modules/apib2swagger/bin/apib2swagger.js:67:5)
at emitNone (events.js:111:20)
Gist for the file: https://gist.github.com/JesperWe/8ce928186f25a8739e31af43f76dc375
I fixed a bug at v1.3.1. Thank you!
Hi @kminami, it seems like the issue still persists. Sample file is from Teamleader Focus
When running the command apib2swagger -i C:\Users\Dev\Downloads\teamleadercrm.apib
, the program crashes with the log
TypeError: Cannot read properties of undefined (reading 'length')
at convertEnum (C:\Users\Dev\AppData\Roaming\npm\node_modules\apib2swagger\src\mson_to_json_schema.js:103:34)
at convert (C:\Users\Dev\AppData\Roaming\npm\node_modules\apib2swagger\src\mson_to_json_schema.js:35:20)
at C:\Users\Dev\AppData\Roaming\npm\node_modules\apib2swagger\src\mson_to_json_schema.js:32:83
at Array.map (<anonymous>)
at convert (C:\Users\Dev\AppData\Roaming\npm\node_modules\apib2swagger\src\mson_to_json_schema.js:32:72)
at convert (C:\Users\Dev\AppData\Roaming\npm\node_modules\apib2swagger\src\mson_to_json_schema.js:59:30)
at convertMsonToJsonSchema (C:\Users\Dev\AppData\Roaming\npm\node_modules\apib2swagger\src\mson_to_json_schema.js:6:18)
at C:\Users\Dev\AppData\Roaming\npm\node_modules\apib2swagger\index.js:77:32
at Array.forEach (<anonymous>)
at C:\Users\Dev\AppData\Roaming\npm\node_modules\apib2swagger\index.js:62:26
Hi @maxi07, I have fixed the issue around teamleadercrm.apib
at v1.16.1.
Please confirm. Thank you!