У меня есть веб-служба JAX-RS
, которую я хочу задокументировать с помощью Swagger 2.1
. В настоящее время это возможно, только если я также включу Jackson.
Есть ли возможность использовать Swagger 2.1
без Jackson
и по умолчанию с Jaxb
и Jsonb
. Без Jackson
я сейчас получаю следующее исключение при запуске приложения:
Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.annotation.JsonAnySetter.enabled()Z
at com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector.hasAnySetter (JacksonAnnotationIntrospector.java:1262)
at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector._addMethods (POJOPropertiesCollector.java:538)
at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.collectAll (POJOPropertiesCollector.java:309)
at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.getPropertyMap (POJOPropertiesCollector.java:287)
at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.getProperties (POJOPropertiesCollector.java:170)
at com.fasterxml.jackson.databind.introspect.BasicBeanDescription._properties (BasicBeanDescription.java:164)
at com.fasterxml.jackson.databind.introspect.BasicBeanDescription.findProperties (BasicBeanDescription.java:239)
at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory._findCreatorsFromProperties (BasicDeserializerFactory.java:292)
at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory._constructDefaultValueInstantiator (BasicDeserializerFactory.java:276)
at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory.findValueInstantiator (BasicDeserializerFactory.java:224)
at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.buildBeanDeserializer (BeanDeserializerFactory.java:220)
at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.createBeanDeserializer (BeanDeserializerFactory.java:143)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2 (DeserializerCache.java:411)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer (DeserializerCache.java:349)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2 (DeserializerCache.java:264)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer (DeserializerCache.java:244)
at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer (DeserializerCache.java:142)
at com.fasterxml.jackson.databind.DeserializationContext.findNonContextualValueDeserializer (DeserializationContext.java:466)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve (BeanDeserializerBase.java:473)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2 (DeserializerCache.java:293)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer (DeserializerCache.java:244)
at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer (DeserializerCache.java:142)
at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer (DeserializationContext.java:476)
at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer (ObjectMapper.java:4389)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose (ObjectMapper.java:4198)
at com.fasterxml.jackson.databind.ObjectMapper.readValue (ObjectMapper.java:3205)
at com.fasterxml.jackson.databind.ObjectMapper.readValue (ObjectMapper.java:3173)
at io.swagger.v3.oas.integration.ContextUtils.deepCopy (ContextUtils.java:18)
My pom.xml
выглядит так:
<dependencies>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-jaxrs2</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-jaxrs2-servlet-initializer-v2</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.10.1</version>
</dependency>
</dependencies>