swagger-api / swagger-core

Examples and server integrations for generating the Swagger API Specification, which enables easy access to your REST API
http://swagger.io
Apache License 2.0
7.39k stars 2.19k forks source link

update jackson to latest 2.11.1+ #3554

Closed frantuma closed 4 years ago

frantuma commented 4 years ago

see

Xexanos commented 4 years ago

Are there any news on a timeline for this update?

frantuma commented 4 years ago

no fixed ETA, probably within next release; things should work probably fine though with 2.11.1+ if you define version in your POM / build system

nhenneaux commented 4 years ago

I have tested using jackson 2.11.0 on our project and it was failing since a deprecated method was removed.


java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.introspect.AnnotatedMember.getType(Lcom/fasterxml/jackson/databind/type/TypeBindings;)Lcom/fasterxml/jackson/databind/JavaType;
    at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:424)
    at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:202)
qwazer commented 4 years ago

The same issue when use swagger-core-1.6.1 and jackson-databind-2.11.0.jar

Caused by: java.lang.NoSuchMethodError: 'com.fasterxml.jackson.databind.JavaType com.fasterxml.jackson.databind.introspect.AnnotatedMember.getType(com.fasterxml.jackson.databind.type.TypeBindings)'
    at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:425) ~[swagger-core-1.6.1.jar:1.6.1]
    at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:203) ~[swagger-core-1.6.1.jar:1.6.1]
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
    io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:425)
The following method did not exist:
    'com.fasterxml.jackson.databind.JavaType com.fasterxml.jackson.databind.introspect.AnnotatedMember.getType(com.fasterxml.jackson.databind.type.TypeBindings)'
The method's class, com.fasterxml.jackson.databind.introspect.AnnotatedMember, is available from the following locations:
    jar:file:/home/ar/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.11.0/jackson-databind-2.11.0.jar!/com/fasterxml/jackson/databind/introspect/AnnotatedMember.class
It was loaded from the following location:
    file:/home/ar/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.11.0/jackson-databind-2.11.0.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of com.fasterxml.jackson.databind.introspect.AnnotatedMember
  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.3.0.RELEASE)
qwazer commented 4 years ago

things should work probably fine though

@frantuma it is not work fine because of NoSuchMethod error

frantuma commented 4 years ago

This is waiting for feedback on jackson PR; after that is clarified this can be implemented in master by updating version (and fixing quoting in tests if there is no progress in jackson PR), and in 1.5 version,by updating deprecated calls member.getType(beanDesc.bindingsForBeanType()); with member.getType(); in ModelResolver (and fixing quoting in tests if there is no progress in jackson PR)

frantuma commented 4 years ago

implemented in #3601 and #3574

xcv58 commented 4 years ago

Thanks @frantuma

Do we have an estimate when the fix will be released?

qwazer commented 4 years ago

@xcv58 As I understand release date can be tracked here: https://github.com/swagger-api/swagger-core/milestone/37

frantuma commented 4 years ago

@qwazer this is not correct, at least at the moment we are not cutting a release at the end of milestones; that said, 2.1.3 was released on June 27th

blop commented 4 years ago

Looks better with 1.6.2-SNAPSHOT, but I have another unrelated issue now ;-)

xcv58 commented 4 years ago

Hi @frantuma

I upgrade to the latest swagger-core@2.1.3 and Jackson@2.11.1. However, there is still the same error:

Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.introspect.AnnotatedMember.getType(Lcom/fasterxml/jackson/databind/type/TypeBindings;)Lcom/fasterxml/jackson/databind/JavaType;
        at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:425)
        at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:203)

It can be reproduced via https://github.com/xcv58/finatra-swagger/pull/1

All dependencies are defined here: https://github.com/xcv58/finatra-swagger/blob/8572a0637fcd9519345a3730ae3b1a33319236db/build.sbt#L29-L37

I'm not sure it's the same bug or a different one. Could you please take a look?

frantuma commented 4 years ago

@xcv58 from the stack trace and looking at your code, you are using swagger 1.x (1.5 branch) and not 2.x (master branch); I guess you're picking up the version transitively from swagger-scala-module, which is not the latest (supporting Jackson 2.11.1); you should add a dependency to latest io.swagger:swagger-core 1.x version 1.6.2

xcv58 commented 4 years ago

Thanks @frantuma

You are correct, I will work with them to figure out how can we upgrade.