Describe the bug
SpringDocHateoasConfiguration assumes a LinkRelationProvider bean can be injected, but doesn't verify that such a bean actually exists.
To Reproduce
Steps to reproduce the behavior:
- What version of spring-boot you are using?
Spring Boot 4.1.1.
- What modules and versions of springdoc-openapi are you using?
springdoc-openapi-starter-webmvc-api 3.1.1.
- What is the actual and the expected result using OpenAPI Description (yml or json)?
Not applicable.
- Provide with a sample code (HelloController) or Test that reproduces the problem
org.springdoc.core.configuration.SpringDocHateoasConfiguration#collectionModelContentConverter(HateoasHalProvider, LinkRelationProvider) requires a LinkRelationProvider bean. This auto-configuration class verifies that the LinkRelationProvider class is present using @ConditionalOnClass (on multiple levels even, which seems redundant), but it never verifies that a bean of this type is present (using @ConditionalOnBean), so the auto-configuration fails when there is no LinkRelationProvider bean:
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'modelConverterRegistrar' defined in class path resource [org/springdoc/core/configuration/SpringDocConfiguration.class]: Unsatisfied dependency expressed through method 'modelConverterRegistrar' parameter 0: Error creating bean with name 'collectionModelContentConverter' defined in class path resource [org/springdoc/core/configuration/SpringDocHateoasConfiguration.class]: Unsatisfied dependency expressed through method 'collectionModelContentConverter' parameter 1: No qualifying bean of type 'org.springframework.hateoas.server.LinkRelationProvider' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
Expected behavior
- A clear and concise description of what you expected to happen.
I expect SpringDocHateoasConfiguration to not fail when the LinkRelationProvider class is present, but there is no bean of this type.
- What is the expected result using OpenAPI Description (yml or json)?
Not applicable.
Describe the bug
SpringDocHateoasConfigurationassumes aLinkRelationProviderbean can be injected, but doesn't verify that such a bean actually exists.To Reproduce
Steps to reproduce the behavior:
Spring Boot 4.1.1.
springdoc-openapi-starter-webmvc-api 3.1.1.
Not applicable.
org.springdoc.core.configuration.SpringDocHateoasConfiguration#collectionModelContentConverter(HateoasHalProvider, LinkRelationProvider)requires aLinkRelationProviderbean. This auto-configuration class verifies that theLinkRelationProviderclass is present using@ConditionalOnClass(on multiple levels even, which seems redundant), but it never verifies that a bean of this type is present (using@ConditionalOnBean), so the auto-configuration fails when there is noLinkRelationProviderbean:Expected behavior
I expect
SpringDocHateoasConfigurationto not fail when theLinkRelationProviderclass is present, but there is no bean of this type.Not applicable.