Skip to content

Releases: softwaremill/tapir

v0.17.0

16 Dec 12:41
Compare
Choose a tag to compare

Breaking changes

  • Compatibility with sttp3. The 4th type parameter of Endpoint (and also the last type parameter of ServerEndpoint) changed from containing the supported stream type or Nothing, to a combination of supported capabilities (which can include: streaming and web sockets support) or Any`. See softwaremill/sttp#610 for more information on the design of the capabilities system. This means that the type of the default endpoint is now:
val endpoint: Endpoint[Unit, Unit, Unit, Any]
  • instead of Endpoint[Unit, Unit, Unit, Nothing]. How to migrate?

    • replace usages of Nothing with Any in endpoint types
    • instead stream types, e.g. Endpoint[I, E, O, Source[ByteString, Any]], use the capability: Endpoint[I, E, O, AkkaStreams]
  • the signature of streamBody changed slightly. The first parameter now needs to be the companion object for the stream capability (e.g. AkkaStreams, Fs2Streams, ZioStreams).

  • Schema derivation is configurable, either automatic derivation (which was the default before) or semi-automatic derivation can be used. See the docs. How to migrate? Add an explicit import:

import sttp.tapir.generic.auto._

in the source files where an implicit Schema can no longer be found. You can also use the SchemaDerivation mixin.

  • Validators are now part of schemas. Validator values are no longer looked up as implicit values, but instead should be added to schemas. How to migrate? If you had an implicit validator instance for a custom type, you'll need to modify the schema to add it; take a look at schema customisation in the docs to see how to customise derived schemas. For example:
implicit def schemaForColor: Schema[Color] = Schema.string
  .validate(Validator.enum(List(Blue, Red), { c => Some(plainCodecForColor.encode(c)) }))

New features

Credits

@danilbykov @mszczygiel @tg44 @sbrunk @erikvanoosten @adamw @jan0sch @erikvanoosten @kciesielski @andyczerwonka @CucumisSativus @gaeljw @johnspade @ghostbuster91

(in random order) Thank you!

What next?

Vote on the issue you'd like to see resolved (yes, we're looking at the 👍 that you are leaving there :) ).

And more generally ... let us know where you'd like to see Scala headed in the Scala developer survey - thanks!

v0.17.0-M11

09 Dec 20:22
Compare
Choose a tag to compare

What’s Changed

v0.17.0-M10

01 Dec 18:18
Compare
Choose a tag to compare

What’s Changed

v0.17.0-M9

19 Nov 15:55
Compare
Choose a tag to compare

Auto/semi auto derivation: Validator and Schema derivations are now configurable. In order make your code compile as it was before, you need to add an explicit import:

import sttp.tapir.generic.auto._

or separately:

import sttp.tapir.generic.schema._
import sttp.tapir.generic.validator._

You can also use ValidatorDerivation and SchemaDerivation mixins. See https://tapir.softwaremill.com/en/latest/endpoint/customtypes.html#schema-derivation for more details.

There's also a ScalaFix migration available: https://github.com/xela85/TapirGenericAutoMigration.

v0.17.0-M8

03 Nov 09:03
Compare
Choose a tag to compare

What’s Changed

v0.17.0-M7

02 Nov 14:33
Compare
Choose a tag to compare

What’s Changed

v0.17.0-M6

30 Oct 15:49
Compare
Choose a tag to compare

What’s Changed

v0.17.0-M5

26 Oct 11:26
Compare
Choose a tag to compare

What’s Changed

v0.17.0-M4

22 Oct 14:03
Compare
Choose a tag to compare

What’s Changed

  • #315: configurable coproducts schema derivation (#806) @adamw
  • Better ZIO integration, always using the environment (#803) @adamw

v0.17.0-M3

21 Oct 11:38
Compare
Choose a tag to compare

What’s Changed