Skip to content

Releases: softwaremill/tapir

v0.19.0-M1

15 Jul 20:14

Choose a tag to compare

What’s Changed

v0.18.0

09 Jul 16:31

Choose a tag to compare

Summary

The main features in this release:

  • Scala3 support: core, http4s & vertx servers, sttp client, as well as some json and datatypes integrations are available in the JVM flavor
  • content negotiation on server & client side
  • the structure of data is reflected only in schemas, not in validators. Validators are much simpler now, and part of schemas
  • server interpreters have been rewritten, and support two types of interceptors (request & endpoint interceptors). Some functionalities (logging, decode failure handling) are implemented as interceptors; custom interceptors can be added
  • exceptions are handled and result in the 500 status code
  • The generated documentation will now include an entry for 400 Bad Request by default, if none is specified by the user, enumerating the reasons on why request decoding might fail. This can be turned off or adjusted in OpenAPIDocsOptions.
  • ZIO Http server interpreter

Thanks to all the contributors for their cooperation, especially @mbore, @kubinio123, @bartekzylinski, @slabiakt, @danielleontiev, @hamnis, @majk-p, @MichalPawlicki, @PawelJ-PL, @endertunc, @ae0n!

Major breaking changes

  • SchemaTypes are not objects, but classes. If you specified the schema type manually, instead of e.g. SchemaType.SString you'll have to use SchemaType.SString()
  • server options have been significantly refactored. To create custom options, use e.g. AkkaServerOptions.customInterceptors
  • Validator.enum method has been renamed to Validator.enumeration, and .derivedEnum to .derivedEnumeration, as enum is now a keyword in Scala3
  • due to changes to companion objects in Scala3, .mapTo(Companion) is replaced with a macro: .mapTo[CaseClass]
  • akka server interpreter: removal of .toDirective
  • annotations have been moved; endpoint annotations to EndpointIO.annotations, and schema annotations to Schema.annotations. Instead of derivedEndpointInput, used EndpointInput.derived instead
  • options for interpreters are now passed as explicit parameters to the interpreters, not as implicit ones to individual methods. If no options are provided, default parameters are used. If you've used default parameters, you'll need to add () to the interpreter, as it is now a class, not an object. E.g. AkkaHttpServerInterpreter.toRoutes(endpoints) becomes:
AkkaHttpServerInterpreter().toRoutes(endpoints)

If you have custom options, you'll need to change code such as:

implicit val options = AkkaHttpServerOptions.customInterceptors(...)
AkkaHttpServerInterpreter.toRoutes(endpoints)

into:

val options = AkkaHttpServerOptions.customInterceptors(...)
AkkaHttpServerInterpreter(options).toRoutes(endpoints)

Other breaking changes

  • rewritten SchemaType.[SProduct|SCoproduct|SOpenProduct]
  • DecodeFailureHandler - minor changes in method signatures, the default one is now DefaultDecodeFailureHandler.handler
  • LogRequestHandling -> ServerLog
  • Codec is no longer a Mapping
  • play server interpreter: toRoute -> toRoutes
  • deprecated statusMapping in favor of oneOfMapping
  • enumerations in openapi model (parameters, parameter style) are now sealed trait families
  • schema improvements: SObjectInfo is replaced by SName; coproducts are more general, as they can include any child schemas (not only objects)
  • enums are referenced by default, there's no referenceEnums option in the documentation interpreters. To inline enums, you'll need to define the enum validator without a name, or remove the name from the derived schema.

What’s Changed since v0.18.0-M18

  • Change backend client for awsLambda (#1365) @bartekzylinski
  • Zhttp (#1337) @bartekzylinski
  • Fixed Validator methods names (#1362) @gruggiero
  • Annotations cleanup: scoping, schema annotations support (#1351) @adamw
  • Move methods to derive endpoint inputs/outputs to companion objects, rename the methods to derived (#1348) @adamw

Dependency updates since v0.18.0-M18

v0.17.20

06 Jul 19:21

Choose a tag to compare

What’s Changed

  • circe updated to 0.14.1

v0.18.0-M18

29 Jun 15:35

Choose a tag to compare

Breaking changes

  • options for interpreters are now passed as explicit parameters to the interpreters, not as implicit ones to individual methods. If no options are provided, default parameters are used. If you've used default parameters, you'll need to add () to the interpreter, as it is now a class, not an object. E.g. AkkaHttpServerInterpreter.toRoutes(endpoints) becomes:
AkkaHttpServerInterpreter().toRoutes(endpoints)

If you have custom options, you'll need to change code such as:

implicit val options = AkkaHttpServerOptions.customInterceptors(...)
AkkaHttpServerInterpreter.toRoutes(endpoints)

into:

val options = AkkaHttpServerOptions.customInterceptors(...)
AkkaHttpServerInterpreter(options).toRoutes(endpoints)
  • schema improvements: SObjectInfo is replaced by SName; coproducts are more general, as they can include any child schemas (not only objects)
  • enums are referenced by default, there's no referenceEnums option in the documentation interpreters. To inline enums, you'll need to define the enum validator without a name, or remove the name from the derived schema.

What’s Changed

v0.18.0-M17

18 Jun 16:51

Choose a tag to compare

New features

Some of the modules are now available for Scala3 on the JVM: core, http4s & vertx servers, sttp client, as well as some json and datatypes integrations

Breaking changes

  • Validator.enum method has been renamed to Validator.enumeration, and .derivedEnum to .derivedEnumeration, as enum is now a keyword in Scala3
  • due to changes to companion objects in Scala3, .mapTo(Companion) is replaced with a macro: .mapTo[CaseClass]
  • enumerations in openapi model (parameters, parameter style) are now sealed trait families

What’s Changed

v0.18.0-M15

04 Jun 08:56

Choose a tag to compare

What’s Changed

v0.18.0-M11

19 May 10:19

Choose a tag to compare

What’s Changed

v0.18.0-M10

07 May 20:01

Choose a tag to compare

Breaking changes

The generated documentation will now include an entry for 400 Bad Request by default, if none is specified by the user, enumerating the reasons on why request decoding might fail. This can be turned off od adjusted in OpenAPIDocsOptions.

What’s Changed

v0.18.0-M9

04 May 13:45

Choose a tag to compare

What’s Changed

v0.18.0-M8

30 Apr 12:44

Choose a tag to compare

What’s Changed