You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Caused by: java.lang.Exception: Error resolving API specification: null
at io.swagger.v3.jaxrs2.integration.SwaggerLoader.resolve(SwaggerLoader.java:270)
... 102 more
Caused by: java.lang.NullPointerException
at io.swagger.v3.core.jackson.ModelResolver._addEnumProps(ModelResolver.java:944)
at io.swagger.v3.core.jackson.ModelResolver.resolve(ModelResolver.java:285)
at io.swagger.v3.core.converter.ModelConverterContextImpl.resolve(ModelConverterContextImpl.java:97)
at io.swagger.v3.core.jackson.ModelResolver.resolve(ModelResolver.java:654)
at io.swagger.v3.core.converter.ModelConverterContextImpl.resolve(ModelConverterContextImpl.java:97)
at io.swagger.v3.core.converter.ModelConverters.resolveAsResolvedSchema(ModelConverters.java:117)
at io.swagger.v3.jaxrs2.Reader.parseMethod(Reader.java:1065)
at io.swagger.v3.jaxrs2.Reader.parseMethod(Reader.java:863)
at io.swagger.v3.jaxrs2.Reader.read(Reader.java:459)
at io.swagger.v3.jaxrs2.Reader.read(Reader.java:168)
at io.swagger.v3.jaxrs2.Reader.read(Reader.java:196)
at io.swagger.v3.oas.integration.GenericOpenApiContext.read(GenericOpenApiContext.java:555)
at io.swagger.v3.jaxrs2.integration.SwaggerLoader.resolve(SwaggerLoader.java:235)
... 102 more
Looks like this is because of Jackson #2480
Where they separated out a new JavaType.isEnumImplType method starting with Jackson 2.11.
Now java.lang.Enum is detected as isEnumType, but because it has no enum constants it runs into this NPE
Tested with swagger 2.1.6
The text was updated successfully, but these errors were encountered:
@russm3086
One workaround you could have for now, if you are building with maven, is to precise your dependencies for jackson artifacts. Basically, use versions prior to 2.11 (I've made it work with 2.9).
I've identified 3 that work together and need to have compatible versions : jackson-databind (which is here the main problem in this issue), jackson-core and jackson-annotations. There may be more depending what kind of libraries you are using.
By precising the version on your pom.xml, you will "override" the ones brought with swagger-core, even if they are more recent.
If you have a class that looks like this (unrealistic):
or like this (stripped down version of our class; which has extending classes with the actual enum implementations used for serialization):
then swagger fails with:
Looks like this is because of Jackson #2480
Where they separated out a new JavaType.isEnumImplType method starting with Jackson 2.11.
Now
java.lang.Enum
is detected as isEnumType, but because it has no enum constants it runs into this NPETested with swagger 2.1.6
The text was updated successfully, but these errors were encountered: