Skip to content

SB 3.5.x compatibility #3005

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

Open
silviuburceadev opened this issue May 23, 2025 · 2 comments · May be fixed by #3007
Open

SB 3.5.x compatibility #3005

silviuburceadev opened this issue May 23, 2025 · 2 comments · May be fixed by #3007

Comments

@silviuburceadev
Copy link

silviuburceadev commented May 23, 2025

SB 3.5.0 comes with a breaking change, a method was renamed, which causes method not found at start-up:

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

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    org.springdoc.core.providers.HateoasHalProvider.isHalEnabled(HateoasHalProvider.java:81)

The following method did not exist:

    'boolean org.springframework.boot.autoconfigure.hateoas.HateoasProperties.getUseHalAsDefaultJsonMediaType()'

The calling method's class, org.springdoc.core.providers.HateoasHalProvider, was loaded from the following location:

    jar:file:/Users/silviu.burcea/.m2/repository/org/springdoc/springdoc-openapi-starter-common/2.8.8/springdoc-openapi-starter-common-2.8.8.jar!/org/springdoc/core/providers/HateoasHalProvider.class

The called method's class, org.springframework.boot.autoconfigure.hateoas.HateoasProperties, is available from the following locations:

    jar:file:/Users/silviu.burcea/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/3.5.0/spring-boot-autoconfigure-3.5.0.jar!/org/springframework/boot/autoconfigure/hateoas/HateoasProperties.class

The called method's class hierarchy was loaded from the following locations:

    org.springframework.boot.autoconfigure.hateoas.HateoasProperties: file:/Users/silviu.burcea/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/3.5.0/spring-boot-autoconfigure-3.5.0.jar

getUseHalAsDefaultJsonMediaType is now called isUseHalAsDefaultJsonMediaType. I have reported the issue to Spring team as well, see spring-projects/spring-boot#45648, I'm not sure if they will revert the change or if you need to bump minor version to have SB 3.5.x compatibility. I'm happy to contribute once it's clear which project needs to change.

@straurob
Copy link

According to this comment, Spring Boot will not implement a workaround for this.

spring-projects/spring-boot#45648 (comment)

@mschout
Copy link
Contributor

mschout commented May 23, 2025

Seems upstream is unlikely to fix, so either should bump min required spring boot version to 3.5.0 or use reflection to support older versions. I'll make an MR for the later shortly in case you want to go that route. Guessing this is a quick fix.

mschout added a commit to mschout/springdoc-openapi that referenced this issue May 23, 2025
Spring Boot renamed the property methods to determine if HAL is enabled
or not.  Use reflection to determine which method to call so we can
support both versions

Fixes springdoc#3005
@mschout mschout linked a pull request May 23, 2025 that will close this issue
mschout added a commit to mschout/springdoc-openapi that referenced this issue May 23, 2025
Spring Boot renamed the property methods to determine if HAL is enabled
or not.  Use reflection to determine which method to call so we can
support both versions

Fixes springdoc#3005
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants