glennjones/hapi-swagger — pull request #86 by srlmproductions (2014-11-29 07:26:35+00:00)
Title: Remove default authorizations to prevent errors on routes with HAPI auth.

Pull request #84 introduced a bug. If a route has authentication defined but hapi-swagger authorizations didn't have a matching field then Hapi throws an error when you try to access a path:

http://localhost:3000/docs?path=something

```
141129/065345.304, internalError, message: Uncaught error: Cannot read property 'type' of undefined stack: TypeError: Uncaught error: Cannot read property 'type' of undefined
at .../node_modules/hapi-swagger/lib/index.js:262:76
```

With this change I fixed it so that, if authorization is not set in hapi-swagger configuration then it's not added to the documentation. This allows us to use authorization methods not supported by swagger (ie, cookies).