-
We're migrating to Smallrye from the Swagger Maven plugin. One thing that I can't find with Smallrye is the configuration of a global security scheme. In the Swagger Maven plugin, I configure <plugin>
<groupId>io.openapitools.swagger</groupId>
<artifactId>swagger-maven-plugin</artifactId>
<configuration>
<swaggerConfig>
<components>
<securitySchemes>
<basicAuth>
<description>Basic authentication</description>
<type>http</type>
<scheme>basic</scheme>
<in>header</in>
</basicAuth>
</securitySchemes>
</components>
<securityRequirements>
<one>
<entries>
<entry>
<name>basicAuth</name>
</entry>
</entries>
</one>
</securityRequirements>
</swaggerConfig>
</configuration>
</plugin> The generated "securitySchemes" : {
"basicAuth" : {
"type" : "http",
"description" : "Basic authentication",
"scheme" : "basic"
}
} As far as I understand, for Smallrye I would have to annotate Is there any way to configure this globally? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Hi @cristalp , if you have a class extending |
Beta Was this translation helpful? Give feedback.
-
Thanks, we're almost there :-) "securitySchemes" : {
"basicAuth" : {
"type" : "http",
"description" : "Basic authentication",
"scheme" : "basic"
}
} Looking at the old {
"openapi" : "3.0.1",
"security" : [ {
"basicAuth" : [ ]
} ]
} The |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot! I also had to add @OpenAPIDefinition(security = @SecurityRequirement(name = "basicAuth"), info = @Info(title = "", version = "")) |
Beta Was this translation helpful? Give feedback.
Add this, also to the Application class: