jensoleg / swagger-ui

Swagger UI is a dependency-free collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
http://swagger.io
Other
1.14k stars 310 forks source link

Official Swagger Test Definition Not Working #20

Closed BSalita closed 9 years ago

BSalita commented 9 years ago

Wonderful project. However, I am unable to get this official Swagger definition to work. Methods are missing.

https://raw.githubusercontent.com/swagger-api/swagger-spec/master/examples/v2.0/json/petstore-expanded.json

Randomly picking Swagger definitions at http://theapistack.com/companies.html shows many are not working either.

jensoleg commented 9 years ago

Hi @BSalita

This project uses the "summary" field to populate the navigation menus and this field is missing in the definition file. I also noticed that the samples are not rendered correct. This is because the Pet object definition has an embedded reference to the NewPet object. This is not handled yet by this repo.

I have modified the definition file - adding the summary fields and flatted the objects. Give it a try.

https://gist.githubusercontent.com/jensoleg/b2fe966d16e5152b5ecd/raw/bc8264c57413b3633808450cdecfa7d4acb3ba39/bsalita

My time is limit at the moment (vacation) but the problem should be fixed. Maybe by someone in the community ?

BSalita commented 9 years ago

It would be great if your project could handle these cases. I would certainly use it. However, it's really not a big issue for me. Your work is very interesting. Thank you.