Closed jonas0616 closed 2 years ago
I'm using fizz@v0.18.1 and trying to generate openapi documentation by the following code:
app.Generator().API().Components.SecuritySchemes = map[string]*openapi.SecuritySchemeOrRef{ "basic_auth": { SecurityScheme: &openapi.SecurityScheme{ Type: "http", Scheme: "basic", }, }, } app.Generator().SetSecurityRequirement(&openapi.SecurityRequirement{"basic_auth": []string{}})
However, swagger UI shows it does not apply security scheme to APIs. Look into the generated openapi.json, security is:
{ "security": { "basic_auth": [] } }
After I change the security format from dictionary to array, it works as expected:
{ "security": [ { "basic_auth": [] } ] }
I'm using fizz@v0.18.1 and trying to generate openapi documentation by the following code:
However, swagger UI shows it does not apply security scheme to APIs. Look into the generated openapi.json, security is:
After I change the security format from dictionary to array, it works as expected: