Created
December 30, 2020 00:53
-
-
Save sabljakovich/9d9e3f187e4f8dfb65fba4ac3b49d1e2 to your computer and use it in GitHub Desktop.
Adds basic auth UI to OpenAPI / Swagger docs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
@SecurityScheme( | |
name = "basicAuth", // can be set to anything | |
type = SecuritySchemeType.HTTP, | |
scheme = "basic" | |
) | |
@OpenAPIDefinition( | |
info = @Info(title = "Sample API", version = "v1"), | |
security = @SecurityRequirement(name = "basicAuth") // references the name defined in the line 3 | |
) | |
class OpenAPIConfiguration { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment