diff --git a/README.md b/README.md index c10e91dcbe..10103c6475 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ tapir documentation is available at [tapir.softwaremill.com](http://tapir.softwa Add the following dependency: ```scala -"com.softwaremill.sttp.tapir" %% "tapir-core" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-core" % "0.17.0-M6" ``` You'll need partial unification enabled in the compiler (alternatively, you'll need to manually provide type arguments in some cases): diff --git a/generated-doc/out/adr/0007-codecs-schemas-configuration.md b/generated-doc/out/adr/0007-codecs-schemas-configuration.md new file mode 100644 index 0000000000..faddcf5483 --- /dev/null +++ b/generated-doc/out/adr/0007-codecs-schemas-configuration.md @@ -0,0 +1,21 @@ +# 7. Codecs and schemas derivation configs +Date: 2020-10-26 + +# Context +In circe and probably in other json libraries there is an option to influence generic derivation by modifying +derivation config and putting it into the derivation scope. Such modification will affect particular codecs but +won't propagate automatically into openapi schema generated by tapir. This modifications include +choosing the namingConvention or specyfing a discriminator field. +(see https://github.com/softwaremill/tapir/issues/315 for more details) + +# Decision +Tapir's schema and json codes will be treated separatelly and require manual synchronization. + +# Other alternatives which were considered +1. Create a super configuration from which tapir and circe configurations can be derived. +This approach has a few flaws. First of all, for circe we would have to create another integration module +as circe-generic isn't present in the basic one. Second, it isn't uncommon for codecs and schemas +to live in separate packages and that brings up the question of where to put this super configuration. +Last but not least, this configuration would require additional import in both codecs and schemas files which +could be easily overlooked, so in summary we think that it doesn't bring that much value to a table. (see +https://github.com/softwaremill/tapir/pull/465 for details) diff --git a/generated-doc/out/docs/asyncapi.md b/generated-doc/out/docs/asyncapi.md index d55df59f3b..c00b11cd47 100644 --- a/generated-doc/out/docs/asyncapi.md +++ b/generated-doc/out/docs/asyncapi.md @@ -3,8 +3,8 @@ To use, add the following dependencies: ```scala -"com.softwaremill.sttp.tapir" %% "tapir-asyncapi-docs" % "0.17.0-M5" -"com.softwaremill.sttp.tapir" %% "tapir-asyncapi-circe-yaml" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-asyncapi-docs" % "0.17.0-M6" +"com.softwaremill.sttp.tapir" %% "tapir-asyncapi-circe-yaml" % "0.17.0-M6" ``` Tapir contains a case class-based model of the asyncapi data structures in the `asyncapi/asyncapi-model` subproject (the diff --git a/generated-doc/out/docs/openapi.md b/generated-doc/out/docs/openapi.md index eb6ad7d8a3..16320ec978 100644 --- a/generated-doc/out/docs/openapi.md +++ b/generated-doc/out/docs/openapi.md @@ -3,8 +3,8 @@ To use, add the following dependencies: ```scala -"com.softwaremill.sttp.tapir" %% "tapir-openapi-docs" % "0.17.0-M5" -"com.softwaremill.sttp.tapir" %% "tapir-openapi-circe-yaml" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-openapi-docs" % "0.17.0-M6" +"com.softwaremill.sttp.tapir" %% "tapir-openapi-circe-yaml" % "0.17.0-M6" ``` Tapir contains a case class-based model of the openapi data structures in the `openapi/openapi-model` subproject (the @@ -70,26 +70,26 @@ akka-http/http4s routes for exposing documentation using [Swagger UI](https://sw ```scala // Akka HTTP -"com.softwaremill.sttp.tapir" %% "tapir-swagger-ui-akka-http" % "0.17.0-M5" -"com.softwaremill.sttp.tapir" %% "tapir-redoc-akka-http" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-swagger-ui-akka-http" % "0.17.0-M6" +"com.softwaremill.sttp.tapir" %% "tapir-redoc-akka-http" % "0.17.0-M6" // Finatra -"com.softwaremill.sttp.tapir" %% "tapir-swagger-ui-finatra" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-swagger-ui-finatra" % "0.17.0-M6" // HTTP4S -"com.softwaremill.sttp.tapir" %% "tapir-swagger-ui-http4s" % "0.17.0-M5" -"com.softwaremill.sttp.tapir" %% "tapir-redoc-http4s" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-swagger-ui-http4s" % "0.17.0-M6" +"com.softwaremill.sttp.tapir" %% "tapir-redoc-http4s" % "0.17.0-M6" // Play -"com.softwaremill.sttp.tapir" %% "tapir-swagger-ui-play" % "0.17.0-M5" -"com.softwaremill.sttp.tapir" %% "tapir-redoc-play" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-swagger-ui-play" % "0.17.0-M6" +"com.softwaremill.sttp.tapir" %% "tapir-redoc-play" % "0.17.0-M6" ``` Note: `tapir-swagger-ui-akka-http` transitively pulls some Akka modules in version 2.6. If you want to force your own Akka version (for example 2.5), use sbt exclusion. Mind the Scala version in artifact name: ```scala -"com.softwaremill.sttp.tapir" %% "tapir-swagger-ui-akka-http" % "0.17.0-M5" exclude("com.typesafe.akka", "akka-stream_2.12") +"com.softwaremill.sttp.tapir" %% "tapir-swagger-ui-akka-http" % "0.17.0-M6" exclude("com.typesafe.akka", "akka-stream_2.12") ``` Usage example for akka-http: diff --git a/generated-doc/out/endpoint/integrations.md b/generated-doc/out/endpoint/integrations.md index 7ebcbcf603..19ecd9bb0e 100644 --- a/generated-doc/out/endpoint/integrations.md +++ b/generated-doc/out/endpoint/integrations.md @@ -6,7 +6,7 @@ The `tapir-cats` module contains additional instances for some [cats](https://ty datatypes as well as additional syntax: ```scala -"com.softwaremill.sttp.tapir" %% "tapir-cats" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-cats" % "0.17.0-M6" ``` - `import sttp.tapir.integ.cats.codec._` - brings schema, validator and codec instances @@ -19,7 +19,7 @@ If you use [refined](https://github.com/fthomas/refined), the `tapir-refined` mo validators for `T Refined P` as long as a codec for `T` already exists: ```scala -"com.softwaremill.sttp.tapir" %% "tapir-refined" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-refined" % "0.17.0-M6" ``` You'll need to extend the `sttp.tapir.codec.refined.TapirCodecRefined` @@ -40,7 +40,7 @@ The `tapir-enumeratum` module provides schemas, validators and codecs for [Enume enumerations. To use, add the following dependency: ```scala -"com.softwaremill.sttp.tapir" %% "tapir-enumeratum" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-enumeratum" % "0.17.0-M6" ``` Then, `import sttp.tapir.codec.enumeratum`, or extends the `sttp.tapir.codec.enumeratum.TapirCodecEnumeratum` trait. diff --git a/generated-doc/out/endpoint/json.md b/generated-doc/out/endpoint/json.md index 6bdb3ae506..7fca145c58 100644 --- a/generated-doc/out/endpoint/json.md +++ b/generated-doc/out/endpoint/json.md @@ -19,7 +19,7 @@ the json codec that is in scope. To use Circe add the following dependency to your project: ```scala -"com.softwaremill.sttp.tapir" %% "tapir-json-circe" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-json-circe" % "0.17.0-M6" ``` Next, import the package (or extend the `TapirJsonCirce` trait, see [MyTapir](../mytapir.md)): @@ -92,7 +92,7 @@ Now the above JSON object will render as To use µPickle add the following dependency to your project: ```scala -"com.softwaremill.sttp.tapir" %% "tapir-json-upickle" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-json-upickle" % "0.17.0-M6" ``` Next, import the package (or extend the `TapirJsonuPickle` trait, see [MyTapir](../mytapir.md) and add `TapirJsonuPickle` not `TapirCirceJson`): @@ -126,7 +126,7 @@ For more examples, including making a custom encoder/decoder, see [TapirJsonuPic To use Play JSON add the following dependency to your project: ```scala -"com.softwaremill.sttp.tapir" %% "tapir-json-play" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-json-play" % "0.17.0-M6" ``` Next, import the package (or extend the `TapirJsonPlay` trait, see [MyTapir](../mytapir.md) and add `TapirJsonPlay` not `TapirCirceJson`): @@ -142,7 +142,7 @@ Play JSON requires `Reads` and `Writes` implicit values in scope for each type y To use Spray JSON add the following dependency to your project: ```scala -"com.softwaremill.sttp.tapir" %% "tapir-json-spray" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-json-spray" % "0.17.0-M6" ``` Next, import the package (or extend the `TapirJsonSpray` trait, see [MyTapir](../mytapir.md) and add `TapirJsonSpray` not `TapirCirceJson`): @@ -158,7 +158,7 @@ Spray JSON requires a `JsonFormat` implicit value in scope for each type you wan To use Tethys JSON add the following dependency to your project: ```scala -"com.softwaremill.sttp.tapir" %% "tapir-json-tethys" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-json-tethys" % "0.17.0-M6" ``` Next, import the package (or extend the `TapirJsonTethys` trait, see [MyTapir](../mytapir.md) and add `TapirJsonTethys` not `TapirCirceJson`): @@ -174,7 +174,7 @@ Tethys JSON requires `JsonReader` and `JsonWriter` implicit values in scope for To use [Jsoniter-scala](https://github.com/plokhotnyuk/jsoniter-scala) add the following dependency to your project: ```scala -"com.softwaremill.sttp.tapir" %% "tapir-jsoniter-scala" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-jsoniter-scala" % "0.17.0-M6" ``` Next, import the package (or extend the `TapirJsonJsoniter` trait, see [MyTapir](../mytapir.md) and add `TapirJsonJsoniter` not `TapirCirceJson`): diff --git a/generated-doc/out/endpoint/zio.md b/generated-doc/out/endpoint/zio.md index fd85c294c8..4d4cc2ded5 100644 --- a/generated-doc/out/endpoint/zio.md +++ b/generated-doc/out/endpoint/zio.md @@ -7,8 +7,8 @@ exposing the endpoints using the [http4s](https://http4s.org) server. You'll need the following dependencies: ```scala -"com.softwaremill.sttp.tapir" %% "tapir-zio" % "0.17.0-M5" -"com.softwaremill.sttp.tapir" %% "tapir-zio-http4s-server" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-zio" % "0.17.0-M6" +"com.softwaremill.sttp.tapir" %% "tapir-zio-http4s-server" % "0.17.0-M6" ``` Next, instead of the usual `import sttp.tapir._`, you should import: diff --git a/generated-doc/out/quickstart.md b/generated-doc/out/quickstart.md index f5cd3d32b4..7839982dc5 100644 --- a/generated-doc/out/quickstart.md +++ b/generated-doc/out/quickstart.md @@ -3,7 +3,7 @@ To use tapir, add the following dependency to your project: ```scala -"com.softwaremill.sttp.tapir" %% "tapir-core" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-core" % "0.17.0-M6" ``` This will import only the core classes needed to create endpoint descriptions. To generate a server or a client, you diff --git a/generated-doc/out/server/akkahttp.md b/generated-doc/out/server/akkahttp.md index 1055439137..a2f0c81deb 100644 --- a/generated-doc/out/server/akkahttp.md +++ b/generated-doc/out/server/akkahttp.md @@ -4,14 +4,14 @@ To expose an endpoint as an [akka-http](https://doc.akka.io/docs/akka-http/curre dependency: ```scala -"com.softwaremill.sttp.tapir" %% "tapir-akka-http-server" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-akka-http-server" % "0.17.0-M6" ``` This will transitively pull some Akka modules in version 2.6. If you want to force your own Akka version (for example 2.5), use sbt exclusion. Mind the Scala version in artifact name: ```scala -"com.softwaremill.sttp.tapir" %% "tapir-akka-http-server" % "0.17.0-M5" exclude("com.typesafe.akka", "akka-stream_2.12") +"com.softwaremill.sttp.tapir" %% "tapir-akka-http-server" % "0.17.0-M6" exclude("com.typesafe.akka", "akka-stream_2.12") ``` Now import the package: diff --git a/generated-doc/out/server/finatra.md b/generated-doc/out/server/finatra.md index a7fa8fbd5f..494582950b 100644 --- a/generated-doc/out/server/finatra.md +++ b/generated-doc/out/server/finatra.md @@ -4,7 +4,7 @@ To expose an endpoint as an [finatra](https://twitter.github.io/finatra/) server dependency: ```scala -"com.softwaremill.sttp.tapir" %% "tapir-finatra-server" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-finatra-server" % "0.17.0-M6" ``` and import the package: @@ -16,7 +16,7 @@ import sttp.tapir.server.finatra._ or if you would like to use cats-effect project, you can add the following dependency: ```scala -"com.softwaremill.sttp.tapir" %% "tapir-finatra-server-cats" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-finatra-server-cats" % "0.17.0-M6" ``` and import the packate: diff --git a/generated-doc/out/server/http4s.md b/generated-doc/out/server/http4s.md index dc3d3dffdb..d6c9eb60e7 100644 --- a/generated-doc/out/server/http4s.md +++ b/generated-doc/out/server/http4s.md @@ -4,7 +4,7 @@ To expose an endpoint as an [http4s](https://http4s.org) server, first add the f dependency: ```scala -"com.softwaremill.sttp.tapir" %% "tapir-http4s-server" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-http4s-server" % "0.17.0-M6" ``` and import the package: diff --git a/generated-doc/out/server/play.md b/generated-doc/out/server/play.md index 3926fb3b25..40624306a5 100644 --- a/generated-doc/out/server/play.md +++ b/generated-doc/out/server/play.md @@ -3,19 +3,19 @@ To expose endpoint as a [play-server](https://www.playframework.com/) first add the following dependencies: ```scala -"com.softwaremill.sttp.tapir" %% "tapir-play-server" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-play-server" % "0.17.0-M6" ``` and (if you don't already depend on Play) ```scala -"com.typesafe.play" %% "play-akka-http-server" % "2.8.2" +"com.typesafe.play" %% "play-akka-http-server" % "2.8.3" ``` or ```scala -"com.typesafe.play" %% "play-netty-server" % "2.8.2" +"com.typesafe.play" %% "play-netty-server" % "2.8.3" ``` depending on whether you want to use netty or akka based http-server under the hood. diff --git a/generated-doc/out/server/vertx.md b/generated-doc/out/server/vertx.md index d3c557d98e..dae61158c8 100644 --- a/generated-doc/out/server/vertx.md +++ b/generated-doc/out/server/vertx.md @@ -4,7 +4,7 @@ Endpoints can be mounted as Vert.x `Route`s on top of a Vert.x `Router`. Use the following dependency ```scala -"com.softwaremill.sttp.tapir" %% "tapir-vertx-server" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-vertx-server" % "0.17.0-M6" ``` Then import the package: diff --git a/generated-doc/out/sttp.md b/generated-doc/out/sttp.md index 14d3d7b5eb..c3320ce027 100644 --- a/generated-doc/out/sttp.md +++ b/generated-doc/out/sttp.md @@ -3,7 +3,7 @@ Add the dependency: ```scala -"com.softwaremill.sttp.tapir" %% "tapir-sttp-client" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-sttp-client" % "0.17.0-M6" ``` To make requests using an endpoint definition using the [sttp client](https://github.com/softwaremill/sttp), import: diff --git a/generated-doc/out/testing.md b/generated-doc/out/testing.md index 0e9433df65..ce7a38229f 100644 --- a/generated-doc/out/testing.md +++ b/generated-doc/out/testing.md @@ -12,7 +12,7 @@ details on how the stub works). Add the dependency: ```scala -"com.softwaremill.sttp.tapir" %% "tapir-sttp-stub-server" % "0.17.0-M5" +"com.softwaremill.sttp.tapir" %% "tapir-sttp-stub-server" % "0.17.0-M6" ``` And the following imports: diff --git a/version.sbt b/version.sbt index e0721990a2..e2e943558b 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -version in ThisBuild := "0.17.0-M5" +version in ThisBuild := "0.17.0-M6"