protect against type == undefined

We had a case where type was undefined in some of the json generated by swagger in response to our annotations. Swagger-ui would essentially become non-responsive in those cases - clicking various API entry points would do nothing. Adding the checks in this merge got the UI to be functional again. We haven't figured out why our annotations were causing type == undefined yet - if we do, we'll either change our annotations, or generate a pull request for that, too.

Side note: Swagger is awesome - you have relieved us of manually keeping a separate wiki in synch, and for that, we thank you!