Skip to content
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

openapi-starter-webmvc-ui:2.0.0-RC1 + openapi-security crashes at startup #1904 #1914

Closed
aijazkeerio opened this issue Oct 26, 2022 · 2 comments
Labels
incomplete incomplete description: Make sure you Provide a Minimal, Reproducible Example - with HelloController

Comments

@aijazkeerio
Copy link

aijazkeerio commented Oct 26, 2022

Describe the bug
This might be related to issues #1607, #1617, and #1904

***************************
APPLICATION FAILED TO START
***************************

Description:

The bean 'webConversionServiceProvider', defined in class path resource [org/springdoc/core/configuration/SpringDocConfiguration$WebConversionServiceConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springdoc/core/SpringDocConfiguration$WebConversionServiceConfiguration.class] and overriding is disabled.

Action:

Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true

To Reproduce
Steps to reproduce the behavior:
Include both dependancies openapi-starter-webmvc-ui:2.0.0-RC1, openapi-security:1.6.12 in a Gradle project using Spring3, OpenApi3. Then start up the application

  • What version of spring-boot you are using?
    • 3.0.0-M4
  • What modules and versions of springdoc-openapi are you using?
    • openapi-starter-webmvc-ui:2.0.0-RC1
    • openapi-security:1.6.12
  • What is the actual and the expected result using OpenAPI Description (yml or json)?
    • JSON
  • Provide with a sample code (HelloController) or Test that reproduces the problem

Expected behavior

  • A clear and concise description of what you expected to happen.
    • Application starts up and shows Swagger UI which also contains default OAuth Endpoints
  • What is the expected result using OpenAPI Description (yml or json)?
    • JSON

Additional context
My project is based on OAuth Server 1.0. And I am trying to show the OAuth Endpoints. As mentioned in this section https://springdoc.org/#spring-security-support, in order to do that I have to include openapi-security.

@aijazkeerio
Copy link
Author

I tried excluding one of the Classes by doing

@ComponentScan(basePackages = {"org.springdoc.core"}, excludeFilters={
        @ComponentScan.Filter(type= FilterType.ASSIGNABLE_TYPE, value=SpringDocConfiguration.class)})

but was presented with this error

org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'springDocConfigProperties' for bean class [org.springdoc.core.properties.SpringDocConfigProperties] conflicts with existing, non-compatible bean definition of same name and class [org.springdoc.core.SpringDocConfigProperties]

So I tried to remove it from org.springdoc.core.properties and set spring.main.allow-bean-definition-overriding=true and was presented with this

Parameter 0 of method swaggerUiConfigParameters in org.springdoc.webmvc.ui.SwaggerConfig required a bean of type 'org.springdoc.core.properties.SwaggerUiConfigProperties' that could not be found.


Action:

Consider defining a bean of type 'org.springdoc.core.properties.SwaggerUiConfigProperties' in your configuration.

Which is somewhat similar to this issue #1209

@bnasslahsen
Copy link
Collaborator

@Aijaz2,

Provide a Minimal, Reproducible Example - with HelloController that reproduces the problem

@bnasslahsen bnasslahsen added the incomplete incomplete description: Make sure you Provide a Minimal, Reproducible Example - with HelloController label Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incomplete incomplete description: Make sure you Provide a Minimal, Reproducible Example - with HelloController
Projects
None yet
Development

No branches or pull requests

2 participants