Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash with .length of undefined #35

Open
JesperWe opened this issue Sep 11, 2018 · 3 comments
Open

Crash with .length of undefined #35

JesperWe opened this issue Sep 11, 2018 · 3 comments

Comments

@JesperWe
Copy link

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

@JesperWe JesperWe changed the title <script src="https://gist.github.com/JesperWe/8ce928186f25a8739e31af43f76dc375.js"></script> Crash with .length of undefined Sep 11, 2018
@kminami
Copy link
Owner

kminami commented Sep 11, 2018

I fixed a bug at v1.3.1.
Thank you!

@maxi07
Copy link

maxi07 commented Jan 10, 2023

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

@kminami
Copy link
Owner

kminami commented Jan 29, 2023

Hi @maxi07, I have fixed the issue around teamleadercrm.apib at v1.16.1.
Please confirm. Thank you!

@kminami kminami reopened this Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants