diff --git a/.travis.yml b/.travis.yml index 65319cf..88f47de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ # See http://about.travis-ci.org/docs/user/build-configuration/ language: scala scala: - - 2.11.8 - - 2.12.1 + - 2.11.9 + - 2.12.4 jdk: - oraclejdk8 before_install: diff --git a/build.sbt b/build.sbt index ce2d357..0a6b21a 100644 --- a/build.sbt +++ b/build.sbt @@ -5,32 +5,40 @@ name := "docless" version := "0.6.0-SNAPSHOT" -val circeVersion = "0.7.0" -val enumeratumVersion = "1.5.7" -val catsVersion = "0.9.0" +val circeVersion = "0.9.1" +val enumeratumVersion = "1.5.12" +val catsVersion = "1.0.1" +val shapelessVersion = "2.3.3" +val ammoniteVersion = "1.0.5" val readme = "README.md" val readmePath = file(".") / readme -scalaVersion := "2.12.1" +scalaVersion := "2.12.4" -crossScalaVersions := Seq("2.11.8", "2.12.1") +crossScalaVersions := Seq("2.11.9", "2.12.4") useGpg := true useGpgAgent := true +enablePlugins(TutPlugin) + +scalacOptions += "-Ypartial-unification" + libraryDependencies ++= Seq( "org.scala-lang" % "scala-reflect" % scalaVersion.value, - "com.chuusai" %% "shapeless" % "2.3.2", + "com.chuusai" %% "shapeless" % shapelessVersion, "com.beachape" %% "enumeratum" % enumeratumVersion, - "com.beachape" %% "enumeratum-circe" % "1.5.9", - "org.typelevel" %% "cats" % catsVersion, + "com.beachape" %% "enumeratum-circe" % enumeratumVersion, + "org.typelevel" %% "cats-core" % catsVersion, + "org.typelevel" %% "cats-kernel" % catsVersion, + "org.typelevel" %% "cats-macros" % catsVersion, "io.circe" %% "circe-core" % circeVersion, "io.circe" %% "circe-parser" % circeVersion, "io.circe" %% "circe-generic" % circeVersion, - "org.scalatest" %% "scalatest" % "3.0.0" % "test", + "org.scalatest" %% "scalatest" % "3.0.5" % "test", "com.github.fge" % "json-schema-validator" % "2.2.6" % "test", - "com.lihaoyi" % "ammonite" % "0.8.1" % "test" cross CrossVersion.full + "com.lihaoyi" % "ammonite" % ammoniteVersion % "test" cross CrossVersion.full ) val predef = Seq( @@ -66,20 +74,18 @@ copyReadme := { val pandocReadme = taskKey[Unit](s"Add a table of content to the README using pandoc") -pandocReadme := { - val readme = copyReadme.value - val log = streams.value.log - val cmd = - s"pandoc -B doc/header.md -f markdown_github --toc -s -S $readme -o $readme" - log.info(s"Running pandoc: $cmd}") - try { Process(cmd) ! log } catch { - case e: java.io.IOException => - log.error( - "You might need to install the pandoc executable! Please follow instructions here: http://pandoc.org/installing.html" - ) - throw e - } - -} - -tutSettings + pandocReadme := { + val readme = copyReadme.value + val log = streams.value.log + val cmd = + s"pandoc -B doc/header.md -f markdown_github --toc -s -S $readme -o $readme" + log.info(s"Running pandoc: $cmd}") + try { new Fork(cmd, None) } catch { + case e: java.io.IOException => + log.error( + "You might need to install the pandoc executable! Please follow instructions here: http://pandoc.org/installing.html" + ) + throw e + } + + } diff --git a/project/build.properties b/project/build.properties index b168a33..c4dc11b 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version = 0.13.13 +sbt.version = 1.1.0 diff --git a/project/plugins.sbt b/project/plugins.sbt index 4116f75..44dc087 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,9 +1,9 @@ logLevel := Level.Warn -//addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "0.5.2") +addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "1.4.0") -addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.4.8") +addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.6.3") -addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0") +addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.1") -addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1") +addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.3") diff --git a/src/main/scala/com/timeout/docless/swagger/Path.scala b/src/main/scala/com/timeout/docless/swagger/Path.scala index 7e07cfc..8b973d8 100644 --- a/src/main/scala/com/timeout/docless/swagger/Path.scala +++ b/src/main/scala/com/timeout/docless/swagger/Path.scala @@ -14,7 +14,7 @@ case class Path(id: String, def paramRefs: Set[RefWithContext] = parameters.flatMap(paramRef).toSet ++ - operations.foldMap(_.parameters.flatMap(paramRef)) + operations.values.toList.foldMap(_.parameters.flatMap(paramRef)) def responseRefs: Set[RefWithContext] = operations.flatMap { diff --git a/src/test/scala/com/timeout/docless/swagger/SwaggerTest.scala b/src/test/scala/com/timeout/docless/swagger/SwaggerTest.scala index 7705bdc..7b39a62 100644 --- a/src/test/scala/com/timeout/docless/swagger/SwaggerTest.scala +++ b/src/test/scala/com/timeout/docless/swagger/SwaggerTest.scala @@ -13,7 +13,7 @@ class SwaggerTest extends FreeSpec { val petstoreSchema = PetstoreSchema() val json = JsonLoader.fromResource("/swagger-schema.json") val schema = JsonSchemaFactory.byDefault().getJsonSchema(json) - val printer = Printer.spaces2.copy(dropNullKeys = true) + val printer = Printer.spaces2.copy(dropNullValues = true) val jsonS = printer.pretty(petstoreSchema.asJson) val report = schema.validate(JsonLoader.fromString(jsonS)) val err = System.err