twskj / pretty-swag

Pretty UI for Swagger spec
MIT License
121 stars 20 forks source link

Error: TypeError: Cannot read property 'length' of undefined #65

Closed fredplourde closed 5 years ago

fredplourde commented 5 years ago

Hi

When updating from 0.1.144 we are getting" Error: TypeError: Cannot read property 'length' of undefined" when generating the pretty-swag html

Any reason why?

Thanks

twskj commented 5 years ago

I could help troubleshoot that but my first initial thought is that it missing some required keys. If you can post the json here, it make it easier to troubleshoot.

fredplourde commented 5 years ago

Hi here is the .json

oct-tau-ecm-api.zip

Which required keys?

Thanks

twskj commented 5 years ago

schemes is missing from the file. Ref: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md

fredplourde commented 5 years ago

Thanks I added a http schemes and it works. One small issue though the "Try This Operation" button is gone from the .html do you know why?

twskj commented 5 years ago

Your schema is missing host

fredplourde commented 5 years ago

Thanks I got it. Close this since there is no bug here 👍