undefined model causes exception in schemaToHTML function in v2.1.1-M2
I am using swagger-ui in v2.1.1-M2.
My swagger.json is validated by swagger-tools 0.10.1 without errors. The swagger.json and externally referenced files can be found in the master branch in https://github.com/itembase/api-swagger
When opening the definition using the swagger-ui, the UI does not show up and the console shows
Uncaught TypeError: Cannot read property 'definition' of undefined in swagger-ui.js:2699
In line 2699 of swagger-ui.js it reads
if (model !== null && model.definition.title !== null && typeof model.definition.title !== 'undefined') {
replacing this with
` if (model != null && model.definition.title !== null && typeof model.definition.title !== 'undefined') {'
seems to address this issue. It then seems to be rendered fine at https://developers.itembase.com/api/docs (this will be moved to https://api.itembase.com/api/docs soon btw.).
Not sure if model should ever be undefined though. Maybe I am doing something wrong in my api spec that is not caught by the validator? Thanks for your help!
Try upgrading to the latest version. You're using what we'd refer to as an ancient version ;)
Closing for no response.