Skip to content

Commit

Permalink
ENG-14940: Add Play 2.8
Browse files Browse the repository at this point in the history
ENG-14940: Add Play 2.8 support from swagger-api#220
  • Loading branch information
feguiguren authored May 29, 2020
2 parents 47ef419 + 942b7de commit 9d1bc70
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

# Swagger Play2 Module

## Note
## Compatibility

This branch (`master`) holds the latest version (major version `2.x`) for latest play version supported (`2.7`); branch [play-2.6](https://github.com/swagger-api/swagger-play/tree/play-2.6) holds the swagger-play version for play `2.6` version (major.minor version `1.6.x`).

Swagger Play Version | Play Version | Branch
---------------------| ------------ | ------
3.0.0 | 2.8 | [master](https://github.com/swagger-api/swagger-play/tree/master)
2.0.0 | 2.7 | [play27](https://github.com/swagger-api/swagger-play/tree/play-2.7)
1.6.x | 2.6 | [play26](https://github.com/swagger-api/swagger-play/tree/play-2.6)

Older versions are available though not anymore supported in the [archive](https://github.com/swagger-api/swagger-play/tree/archive) branch.

Expand Down Expand Up @@ -33,7 +38,7 @@ You can depend on pre-built libraries in maven central by adding the following d

```
libraryDependencies ++= Seq(
"io.swagger" %% "swagger-play2" % "2.0.1-SNAPSHOT"
"io.swagger" %% "swagger-play2" % "3.0.1-SNAPSHOT"
)
```

Expand Down
14 changes: 7 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ scalaVersion := "2.13.1"

crossScalaVersions := Seq(scalaVersion.value, "2.12.10")

val PlayVersion = "2.7.3"
val SwaggerVersion = "1.5.24"
val Specs2Version = "4.6.0"
val PlayVersion = "2.8.1"
val SwaggerVersion = "1.6.0"
val Specs2Version = "4.8.3"

libraryDependencies ++= Seq(
"com.typesafe.play" %% "play" % PlayVersion,
"com.typesafe.play" %% "routes-compiler" % PlayVersion,
"io.swagger" % "swagger-core" % SwaggerVersion,
"io.swagger" %% "swagger-scala-module" % "1.0.6",
"com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.9.9",
"org.scala-lang.modules" %% "scala-collection-compat" % "2.1.2",
"org.slf4j" % "slf4j-api" % "1.7.21",
"com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.10.2",
"org.scala-lang.modules" %% "scala-collection-compat" % "2.1.3",
"org.slf4j" % "slf4j-api" % "1.7.30",

"com.typesafe.play" %% "play-ebean" % "5.0.2" % "test",
"org.specs2" %% "specs2-core" % Specs2Version % "test",
"org.specs2" %% "specs2-mock" % Specs2Version % "test",
"org.specs2" %% "specs2-junit" % Specs2Version % "test",
"org.mockito" % "mockito-core" % "2.21.0" % "test"
"org.mockito" % "mockito-core" % "3.2.0" % "test"
)

// see https://github.com/scala/bug/issues/11813
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/play/modules/swagger/SwaggerPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class SwaggerPluginImpl @Inject()(environment: Environment, configuration: Confi
lazy val swaggerSpecFilter: Option[SwaggerSpecFilter] = config.filterClass match {
case Some(e) if e.nonEmpty =>
try {
val filter = environment.classLoader.loadClass(e).newInstance.asInstanceOf[SwaggerSpecFilter]
val filter = environment.classLoader.loadClass(e).getDeclaredConstructor().asInstanceOf[SwaggerSpecFilter]
logger.debug("Setting swagger.filter to %s".format(e))
Some(filter)
} catch {
Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/PlayApiListingCacheSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ PUT /api/dog/api/:id testdata.DogController.add0(id:String)
swagger.getSwagger must beEqualTo("2.0")
swagger.getBasePath must beEqualTo(basePath)
swagger.getPaths.size must beEqualTo(7)
swagger.getDefinitions.size must beEqualTo(8)
swagger.getDefinitions.size must beEqualTo(10)
swagger.getHost must beEqualTo(swaggerConfig.host)
swagger.getInfo.getContact.getName must beEqualTo(swaggerConfig.contact)
swagger.getInfo.getVersion must beEqualTo(swaggerConfig.version)
Expand Down
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version in ThisBuild := "2.0.1-SNAPSHOT"
version in ThisBuild := "3.0.0-avaya"

0 comments on commit 9d1bc70

Please sign in to comment.