-
Notifications
You must be signed in to change notification settings - Fork 21
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
Error encored during generating TypeError: type.toLocaleLowerCase is not a function #58
Comments
@DeeNeon Thanks for the report. It seems like it tried to lowercase something else than string. Would it be possible to provide at least anonymized swagger file? it would really help me find the problem |
Thank you @vmasek for the follow up. |
Problem is that given swagger seems invalid, if you try to validate it in https://editor.swagger.io/ you get multiple errors, where some are If we look at the docs, there is schamaObject spec which is telling us that means model like
is invalid due to the I'll try to look at why it doesn't tell this when validating or if validation even happens properly. |
Thanks @vmasek I'll check, I actually exported it from Stoplight, and indeed it's invalid... sigh. |
fixes #58 Signed-off-by: Vojtech Mašek <[email protected]>
Steps:
After installing api-client-generator ran
api-client-generator -s ./api.yaml -o ./apidocs
.Assumptions:
YAML is valid.
No errors during installation.
Stack trace shown:
Error encored during generating TypeError: type.toLocaleLowerCase is not a function
at Object.toTypescriptType (/usr/local/lib/node_modules/api-client-generator/dist/helper.js:46:21)
at /usr/local/lib/node_modules/api-client-generator/dist/parser.js:109:39
at Array.map ()
at parseInterfaceProperties (/usr/local/lib/node_modules/api-client-generator/dist/parser.js:106:39)
at defineInterface (/usr/local/lib/node_modules/api-client-generator/dist/parser.js:161:22)
at defineEnumOrInterface (/usr/local/lib/node_modules/api-client-generator/dist/parser.js:75:11)
at /usr/local/lib/node_modules/api-client-generator/dist/parser.js:62:16
at Array.map ()
at parseDefinitions (/usr/local/lib/node_modules/api-client-generator/dist/parser.js:60:10)
at createMustacheViewModel (/usr/local/lib/node_modules/api-client-generator/dist/parser.js:18:22)
Any input is more than welcomed.
Cheers.
The text was updated successfully, but these errors were encountered: