swagger-api / swagger-play

Apache License 2.0
330 stars 181 forks source link

Update to Play 2.7 #187

Closed notflorian closed 5 years ago

notflorian commented 5 years ago

Hello,

Play 2.7 is here.

Could you please update your library to be compatible with this version?

Currently in my project I get the following exception java.lang.NoClassDefFoundError: Could not initialize class io.swagger.converter.ModelConverters

Many thanks

sitwaheed9 commented 5 years ago

please update the swagger for play 2.7

thomaska commented 5 years ago

I think the reason for this is that play 2.7 uses a later version of com.fasterxml.jackson.core:jackson-databind (namely 2.9.8) with which swagger 1.6.x is not compatible with (it uses 2.8.6). Overriding the dependency in sbt worked for me (although I haven't tested it extensively). This means I added this in my build.sbt file

dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-databind" % "2.8.6"

This as a workaround, until swagger gets updated, which would be the proper solution.

youqian commented 5 years ago

Will you guys release a version for playframework 2.7 soon?

For now I added jackson-module-scala-2.9.8 together with swagger-play deps. val swagger = Seq( "io.swagger" %% "swagger-play2" % "1.6.0", "io.swagger" % "swagger-core" % "1.5.22", "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.9.8", "org.webjars" % "swagger-ui" % "3.13.0" )