OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
TL;DR.
I made a simple multi-module maven spring-boot app but building this fails with an error: Failed to load ApplicationContext
caused by: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. ....
Details:
I have made a spring boot app with 2 modules that build correclty.
Adding the dependency of org.openapitools:openapi-generator:5.4.0 results in an error: Failed to load ApplicationContext (for the test unit) and was apparently caused by LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. ....
A few lines above this error I have this warning:
SLF4J: Class path contains multiple SLF4J bindings.
Note that the addition of the dependency was enough for the exception to occur. No generation has been done!
I think the addition of this dependency should not result in an error in the app, especially because it seems related to the logging framework.
Facts
org.openapitools:openapi-generator:5.4.0
spring-boot application: 2.6.7 (from initializr converted to multi-module)
Description:
TL;DR. I made a simple multi-module maven spring-boot app but building this fails with an error: Failed to load ApplicationContext caused by: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. ....
Details: I have made a spring boot app with 2 modules that build correclty. Adding the dependency of org.openapitools:openapi-generator:5.4.0 results in an error: Failed to load ApplicationContext (for the test unit) and was apparently caused by LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. ....
A few lines above this error I have this warning: SLF4J: Class path contains multiple SLF4J bindings.
Note that the addition of the dependency was enough for the exception to occur. No generation has been done!
I think the addition of this dependency should not result in an error in the app, especially because it seems related to the logging framework.
Facts
org.openapitools:openapi-generator:5.4.0 spring-boot application: 2.6.7 (from initializr converted to multi-module)
Code
5 Project files and a directory tree
Workaround I was able to workaround the issue by excluding the slf4j-simple artifact from the generator (see also commented code in OpenApi\pom.xml):