Closed hopla closed 4 years ago
I was looking for the security requirement as well, but I wanted it to be at the global level. Seems like nancy.swagger did not include this.
I think Swagger 2.0 (the version Nancy.Swagger uses) on supports Security Requirements on operations. However it is possible to add Security Defenitions, which are global. e.g. SwaggerMetadataProvider.SetSecuritySchemeBuilder(new BasicSecuritySchemeBuilder(), "Basic");
Ya you are right, I did use the SwaggerMetadataProvider provides SecuritySchema, but eventually I need to add in SecurityRequirement at the global level (in the resulted swagger.json) to make it work, I think it missed something like SetSecurityRequirementBuilder() .
@jnallard Hi, I added a basic-authentication requirement in the Nancy.Swagger.Annotations.Demo sample project. I also fixed the merge conflict that was caused by merging in pull request #175
I have added a RouteSecurityAttribute which allows for adding a security requirement to an operation. Also see #170