-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[REQ][JAVA][SPRING] Adding springdoc-openapi support for service metadata and security #12220
Comments
Update on my ResearchI've been looking into the configuration for Springfox and how OpenAPI 3 can mimick this kind of setup. This should be a scenario which avoids breaking
//necessary imports for spring/OAS models
@Configuration
public class SpringDocConfiguration {
@Bean
OpenAPI apiInfo() {
return new OpenAPI()
.info(
new Info()
.title("Title")
.description("Description")
.termsOfService("")
.contact(
new Contact()
.name("")
.url("")
.email("")
)
.license(
new License()
.name("")
.url("")
)
.version("")
)
.components(
new Components()
.addSecuritySchemes("basic_auth", new SecurityScheme()
.name("basic_auth")
.description("my description")
.scheme("basic")
.type(SecurityScheme.Type.HTTP)
)
);
}
} |
Hi @bluenick2k17, FYI @welshm (2022/02) @MelleD (2022/02) @atextor (2022/02) @manedev79 (2022/02) @javisst (2022/02) @borsch (2022/02) @banlevente (2022/02) |
Just skimmed over your Draft PR. Looks good so far. Let me know if you need any help. |
Is your feature request related to a problem? Please describe.
I am configuring my auto generated API code, and I am concerned because although spring fox won't be supported in the future, springdoc doesn't currently get supplied all of the information that it should be. Without me creating an additional configuration file, the swagger page provided by springdoc just called my API "OpenAPI Definition" and doesn't provide the additional metadata that OpenAPI offers from the yaml file like the rest of the info section, servers, or Security Schemes. Security schemes being set up on this level also enables the authorization features in the swagger UI, which would be a huge functional plus.
Describe the solution you'd like
I would like there to be an additional configuration class created to handle the Open API definitions at least from the following listed annotations, to provide support for some of the swagger UI features that can't currently be used
I figure this would just be an additional class generated (e.g.
SpringDocsUIConfiguration
), which configures the annotations mentioned above and the@Configuration
annotation, so that the docs site can pick up the new details.Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: