You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-1Lines changed: 16 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,7 @@ This plugin does not include the [swagger-ui](https://github.com/wordnik/swagger
55
55
*`cache`: caching options for the swagger schema generation as specified in [`server.method()`](https://github.com/hapijs/hapi/blob/master/API.md#servermethodname-method-options) of hapi, defaults to: `{ expiresIn: 15 * 60 * 1000 }`
56
56
*`responseValidation`: boolean, turn response validation on and off for hapi-swaggered routes, defaults to false
57
57
*`auth`: authentication configuration [hapijs documentation](https://github.com/hapijs/hapi/blob/master/API.md#route-options) (default to undefined)
58
+
*`securityDefinitions`: security definitions according to [swagger specs](https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md]
58
59
59
60
## Example
60
61
Example configuration for hapi-swaggered + hapi-swaggered-ui
@@ -105,7 +106,7 @@ server.route({
105
106
path:'/',
106
107
method:'GET',
107
108
handler (request, h) {
108
-
h.redirect('/docs');
109
+
h.response().redirect('/docs');
109
110
}
110
111
});
111
112
@@ -250,6 +251,20 @@ Specify an operationId for a route:
250
251
}
251
252
```
252
253
254
+
Specify an security options to a route / operation:
255
+
256
+
```js
257
+
{
258
+
options: {
259
+
plugins: {
260
+
'hapi-swaggered': {
261
+
security: {}
262
+
}
263
+
}
264
+
}
265
+
}
266
+
```
267
+
253
268
### Tag filtering
254
269
Routes can be filtered for tags through the tags query parameter beside the requiredTags property which is always required to be present.
0 commit comments