-
-
Notifications
You must be signed in to change notification settings - Fork 528
Spring 4 incompatibility using springdoc-openapi 1.2.30+ #563
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
Comments
Can you please test with v1.3.2 of springdoc-openapi ? |
Test under 1.3.2
Result:
Reliance on org.springframework.boot.context.properties.bind.Binder released in Spring Boot 2.0.0 SpringDocConfiguration:
|
The demo app here uses spring-boot-1 without any issues: Are you enabling cache or using groups ? (It seems to be GroupedOpenApi!) |
I haven't checked out the springdoc-openapi-test-app1 project yet to review the effective POM but looking at the parent POM, it has Spring Boot defined as 2.2.6-RELEASE. Any chance that the effective class being sought is acquired through the parent POM when not found in the child POM's resources for Spring Boot? https://github.com/springdoc/springdoc-openapi-demos/blob/master/pom.xml
|
For the demo1, you can look at the child pom, where the version of spring-boot is overriden. The cause of the issue is confirmed: "org.springframework.boot.context.properties.bind.BindResult" class which has been added on spring-boot 2, related to the cache disable or groups enbaled. Feature about dynamic groups using application.yml, won't be provided out of the box on spring-boot-1 applications. Other features will be available as before with the next release v1.3.3; |
Thanks @bnasslahsen Sorry I didn't answer earlier, I wasn't explicitly using groups or caching at the time, so whatever the defaults are is what I was inherently using. Glad you were able to confirm the issue. Just to be clear, are you saying if I enable cache or disable groups, Spring 4.x + Spring Boot 1.x will work in 1.3.2? And in 1.3.3 (when released) Spring 4.x + Spring Boot 1.x will work with either cache enabled or disabled, but groups won't be supported? |
Correction, I did just verify I had springdoc.cache.disabled=true. Changing it to springdoc.cache.disabled=false did allow me to deploy with v1.3.2, however I'm working through a webjars conflict now. Same error whether I have the following in my POM enabled or disabled:
I'll keep working through the issue, but if you have any ideas, please let me know. Thanks! |
OK, with the following I am able to deploy with 1.3.2 but am back to the original issue of java.lang.NoClassDefFoundError: org/springframework/http/codec/multipart/FilePart Properties:
POM:
|
I can see the the line code that causes this issue. You can set temporarly the repositories section on your pom.xml our settings.xml, if you want to test: <repositories>
<repository>
<id>snapshots-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories> |
Great, 1.3.3-SNAPSHOT got me past that error, have to review other aspects of Springdoc and Swagger, but the /v3/api-docs and /swagger-ui.html endpoints are loading now. Thanks for the extremely fast turnaround! |
I have an existing Spring 4 API and have successfully integrated springdoc-openapi to generate the OpenAPI 3 spec in JSON/YAML and also display the Swagger UI using springdoc-openapi 1.2.29 and Spring Boot 15.2.2.RELEASE, however there appear to be various bugs that were fixed and enhancements added in later versions of springdoc-openapi. Unfortunately I am running into various compatibility issues with Spring 4 if I use versions higher than springdoc-openapi 1.2.29.
Is there an availability compatibility matrix for springdoc-openapi and Spring 4? As I read through the springdoc-openapi documentation, I do not see any readme or release notes suggesting there is a Spring 5 requirement, however as noted below there are Spring 5 classes used in the underlying springdoc-openapi once you reach a certain version.
My relevant POM:
When using springdoc-openapi-ui 1.2.30, it will subsequently bring in springdoc-openapi-common-1.2.30.jar which throw an exception trying to use org.springframework.http.codec.multipart.FilePart. Likewise, using 1.2.34 or higher will throw an exception on MethodParameter.getParameter().
Spring 5 reference: https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/http/codec/multipart/FilePart.html
Any suggestions on how to work around this to leverage the bug fixes and enhancements in springdoc-openapi in later versions?
The text was updated successfully, but these errors were encountered: