Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
60 changes: 33 additions & 27 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
}

}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 0.13.13
sbt.version = 1.1.0
8 changes: 4 additions & 4 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -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")
2 changes: 1 addition & 1 deletion src/main/scala/com/timeout/docless/swagger/Path.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down