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
Hey folks,
I am using dropwizard in connection with Swagger (no Bundle or anything, just Swagger as a plain JAX-RS resource). I played around with java.util.Optional query params a bit. That works fine, but swagger seems to have a problem with Optional.
java.lang.IllegalArgumentException: Unrecognized Type: [null]
at com.fasterxml.jackson.databind.type.TypeFactory._fromAny(TypeFactory.java:1170)
at com.fasterxml.jackson.databind.type.TypeFactory.constructType(TypeFactory.java:618)
at com.fasterxml.jackson.databind.ObjectMapper.constructType(ObjectMapper.java:1543)
at io.swagger.jackson.ModelResolver.resolveProperty(ModelResolver.java:110)
at io.swagger.converter.ModelConverterContextImpl.resolveProperty(ModelConverterContextImpl.java:80)
at io.swagger.jackson.ModelResolver.resolveProperty(ModelResolver.java:156)
at io.swagger.jackson.ModelResolver.resolveProperty(ModelResolver.java:110)
at io.swagger.converter.ModelConverterContextImpl.resolveProperty(ModelConverterContextImpl.java:80)
at io.swagger.converter.ModelConverters.readAsProperty(ModelConverters.java:58)
at io.swagger.jaxrs.DefaultParameterExtension.createProperty(DefaultParameterExtension.java:204)
at io.swagger.jaxrs.DefaultParameterExtension.extractParameters(DefaultParameterExtension.java:66)
at io.swagger.jaxrs.ext.AbstractSwaggerExtension.extractParameters(AbstractSwaggerExtension.java:33)
at io.swagger.jersey.SwaggerJersey2Jaxrs.extractParameters(SwaggerJersey2Jaxrs.java:63)
at io.swagger.jaxrs.DefaultParameterExtension.handleAdditionalAnnotation(DefaultParameterExtension.java:185)
at io.swagger.jaxrs.DefaultParameterExtension.extractParameters(DefaultParameterExtension.java:108)
at io.swagger.jaxrs.ext.AbstractSwaggerExtension.extractParameters(AbstractSwaggerExtension.java:33)
at io.swagger.jersey.SwaggerJersey2Jaxrs.extractParameters(SwaggerJersey2Jaxrs.java:63)
at io.swagger.jaxrs.Reader.getParameters(Reader.java:1035)
at io.swagger.jaxrs.Reader.parseMethod(Reader.java:974)
at io.swagger.jaxrs.Reader.read(Reader.java:322)
at io.swagger.jaxrs.Reader.read(Reader.java:172)
at io.swagger.jaxrs.config.BeanConfig.scanAndRead(BeanConfig.java:242)
at io.swagger.jaxrs.config.BeanConfig.setScan(BeanConfig.java:221)
[...]
at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:43)
at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:85)
at io.dropwizard.testing.DropwizardTestSupport.startIfRequired(DropwizardTestSupport.java:194)
at io.dropwizard.testing.DropwizardTestSupport.before(DropwizardTestSupport.java:112)
at io.dropwizard.testing.junit.DropwizardAppRule.before(DropwizardAppRule.java:128)
at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
This issue is caused because propType.containedType(0) resolves to null (find the source here). I also tried to add jackson in version 2.8.7 manually to the classpath, but it didn't help.
I already found a couple of issues regarding swagger and Optional, but they were all stating that this issue is resolved. Can you guys provide any help?
I'd be glad to help you out with further information.
The text was updated successfully, but these errors were encountered:
Hey folks,
I am using dropwizard in connection with Swagger (no Bundle or anything, just Swagger as a plain JAX-RS resource). I played around with
java.util.Optional
query params a bit. That works fine, but swagger seems to have a problem withOptional
.This issue is caused because
propType.containedType(0)
resolves tonull
(find the source here). I also tried to addjackson
in version2.8.7
manually to the classpath, but it didn't help.I already found a couple of issues regarding swagger and
Optional
, but they were all stating that this issue is resolved. Can you guys provide any help?I'd be glad to help you out with further information.
The text was updated successfully, but these errors were encountered: