forked from loafle/openapi-generator-original
Previous error handling implementation had types returning Either[CommonError, UserType], but implemented with the scala shortcut ??? which throws an exception instead. This causes compilation to fail with a message that the expected CommonError is of type Any. This is often fixable with generic upper bounds constraints, but this is overkill for a placeholder implementation. Returning a temporary 'TODO' type solves the compile error, and should allow CI to check for valid compilation on changes. Included in this is also a fix to support optional query parameter types. The spec used to generate the finch server has optional query parameters, but the version of finch in the template doesn't support options on query parameters. Finch does, however, aggregate everything (headers, query string, path parameters, etc) under "param" with "paramOption" for those which are optional types.
67 lines
2.1 KiB
Scala
67 lines
2.1 KiB
Scala
scalariformSettings
|
|
|
|
organization := "org.openapitools"
|
|
|
|
name := "finch-sample"
|
|
|
|
version := "0.1.0-SNAPSHOT"
|
|
|
|
scalaVersion := "2.12.3"
|
|
|
|
resolvers += Resolver.sonatypeRepo("snapshots")
|
|
|
|
resolvers += "TM" at "http://maven.twttr.com"
|
|
|
|
resolvers += "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository"
|
|
|
|
resolvers += "Sonatype OSS Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/"
|
|
|
|
resolvers += "Sonatype OSS Releases" at "http://oss.sonatype.org/content/repositories/releases/"
|
|
|
|
Defaults.itSettings
|
|
|
|
lazy val circeVersion = "0.8.0"
|
|
lazy val finagleVersion = "6.45.0"
|
|
lazy val finchVersion = "0.15.1"
|
|
lazy val scalaTestVersion = "3.0.0"
|
|
|
|
scalacOptions ++= Seq(
|
|
"-deprecation",
|
|
"-encoding", "UTF-8",
|
|
"-feature",
|
|
"-language:existentials",
|
|
"-language:higherKinds",
|
|
"-language:implicitConversions",
|
|
"-unchecked",
|
|
"-Yno-adapted-args",
|
|
"-Ywarn-dead-code",
|
|
"-Ywarn-numeric-widen",
|
|
"-Xfuture",
|
|
"-Xlint",
|
|
"-Ywarn-unused-import",
|
|
"-language:postfixOps"
|
|
)
|
|
|
|
lazy val `it-config-sbt-project` = project.in(file(".")).configs(IntegrationTest)
|
|
|
|
libraryDependencies ++= Seq(
|
|
"com.github.finagle" %% "finch-core" % finchVersion,
|
|
"com.github.finagle" %% "finch-circe" % finchVersion,
|
|
"io.circe" %% "circe-generic" % circeVersion,
|
|
"io.circe" %% "circe-java8" % circeVersion,
|
|
"com.twitter" %% "util-core" % finagleVersion,
|
|
"com.github.finagle" %% "finch-test" % finchVersion % "test",
|
|
"org.scalacheck" %% "scalacheck" % "1.13.4" % "test",
|
|
"org.scalatest" %% "scalatest" % scalaTestVersion % "test"
|
|
)
|
|
|
|
assemblyMergeStrategy in assembly := {
|
|
case "application.conf" => MergeStrategy.concat
|
|
case "about.html" => MergeStrategy.discard
|
|
case x =>
|
|
val oldStrategy = (assemblyMergeStrategy in assembly).value
|
|
oldStrategy(x)
|
|
}
|
|
|
|
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)
|