Open samylaumonier opened 6 years ago
Same here :'(
See here for a workaround : https://github.com/z0mt3c/hapi-swaggered/issues/165
I switched to hapi-swagger...
I am using a combination of hapi-swagger to create the swagger definition and hapi-swaggered-ui for the ui. Of course, you can just stick with hapi-swagger for both the swagger definition and ui, but I found that hapi-swaggered-ui to be using a more modern version of swagger ui. Hence, why I combined both libraries. With that combination, you can do the following:
Add a securityDefinitions
value to the options
for hapi-swagger.
{
...options,
// documentation for security configs: https://swagger.io/docs/specification/2-0/authentication/
securityDefinitions: {
'Bearer': {
type: 'apiKey',
name: 'Authorization',
in: 'header'
}
},
security: [{
'Bearer': []
}],
documentationPage: false, // we are using `hapi-swaggered-ui` for the ui, so we turn off the ui for
`hapi-swagger`
}
this not work, plz show one exemple, I go error
"securityDefinitions" is not allowed
Hi @z0mt3c, I'm trying to configure hapi-swaggered but I'm not able to display the authenticate button. Do you have a working example using the
authorization
option? Even with your example code, the configuration seems to be useless.Result:
Thanks, Samy