Skip to content

Releases: softwaremill/tapir

v0.20.0-M6

21 Jan 08:54
Compare
Choose a tag to compare

What’s Changed

Breaking changes

  • toRequestUnsafe in http4s and play client interpreters have been renamed to toRequestThrowDecodeFailures

Dependency updates

v0.20.0-M5

14 Jan 15:42
Compare
Choose a tag to compare

What’s Changed

  • Resolve name clashes when using a macro to derive inputs using annotations (#1755) @adamw
  • Swap constructor/method parameter in ServerInterpreter so that it can be created once for a given list of endpoints (#1754) @adamw
  • oneOfBody input/output (#1739) @adamw
  • Scala 2.13 partial unification comment (#1747) @nebasuke
  • added mapping required property for object based on input codec (#1750) @kubinio123
  • Nested descritpions fix (#1624) @Pask423
  • fixed mapSecurityInTo (#1745) @kubinio123

Dependency updates

v0.20.0-M4

07 Jan 12:42
Compare
Choose a tag to compare

What’s Changed

Dependency updates

v0.20.0-M3

22 Dec 18:00
Compare
Choose a tag to compare

What’s Changed

  • Add a way to add (encoded) examples for streaming bodies (#1702) @adamw
  • Allow customisation of the generated OpenAPI model when exposing swagger ui (#1700) @adamw
  • Modify the index.html for Swagger UI so that it references the docs yaml directly (#1697) @adamw
  • Update magnolia to softwaremill's version (#1696) @adamw

Dependency updates

v0.20.0-M2

17 Dec 21:38
Compare
Choose a tag to compare

0.20.0-M1 wasn't published due to problems with the release process.

Breaking changes

  • optional parts in a multipart codec are now represented as a Option[Part[T]], instead of an Part[Option[T]]

What’s Changed

Dependency updates

v0.19.3

17 Dec 23:02
Compare
Choose a tag to compare

0.19.2 wasn't published due to problems with the release process.

What’s Changed

  • Match path exactly even if the path is only specified in the security inputs (#1689) @adamw

v0.19.1

01 Dec 23:44
Compare
Choose a tag to compare

What’s Changed

Dependency updates

v0.19.0

17 Nov 13:18
Compare
Choose a tag to compare

New features

Security

This release focus on security improvements, most notably extending Endpoint with an additional type parameter A for security inputs. In case security endpoints are defined, the security logic has to be provided first, followed by the server logic. Moreover, error outputs can be extended for partial endpoints by adding new error output variants.

More information on the change:

Other

  • cats-effect 3 & http4s 0.23 support; cats-effect 2 support is dropped
  • static file serving support
  • Netty server interpreter
  • more flexible oneOf outputs, which now allow arbitrary outputs, without the need to provide a status code
  • .errorOutVariant for extending error outputs with new variants
  • endpoints with authentication can be hidden by returning a 404 instead of a 401 when an alternate DecodeFailureHandler is used

Migrating from previous versions

  • replace any occurrence of the Endpoint type with PublicEndpoint
  • replace ServerEndpoint[I, E, O, R, F] with ServerEndpoint[R, F] (e.g. ServerEndpointp[Any, Future]), or with ServerEndpoint.Full[Unit, Unit, I, E, O, R, F] if you need to preserve the types of inputs/outputs
  • replace any calls to server interpreter which provided the endpoint and server logic separately, with a call to one of the .serverLogic variants. For example, AkkaHttpServerInterpreter().toRoute(helloWorld)(name => Future.successful(Right(s"Hello, $name!"))) should be replaced with AkkaHttpServerInterpreter().toRoute(helloWorld.serverLogicSuccess(name => Future.successful(s"Hello, $name!"))).

This should make the code compile using the new version. The next step would be to move security-related inputs from .in to .securityIn when defining the endpoint, and taking advantage of the security improvements (e.g. separate security and server logic).

Other breaking changes

  • server interpreters accept only ServerEndpoints. Replace .toRoute(endpoint)(logic) with .toRoute(endpoint.serverLogic(logic))
  • serverLogicInfallible is renamed to serverLogicSuccess
  • ServerLog implementations has an extended interface - the whole request is now available
  • there's are single swagger & redoc modules, see OpenAPI docs
  • specifying custom interceptors is unified across all server interpreters. Previous usages of [Interpreter]ServerOptions.customInterceptors(...) should be replaced with .customInterceptors.[builderMethods]().options
  • ZEndpoint is removed, ZServerEndpoint is extended with capabilities
  • a 405 is returned if multiple endpoints are being interpreted as a server, the request matches the path of some endpoint but not the method

Deprecations

  • oneOfMapping is renamed to oneOfVariant

Towards a stable release

The current plan is to have two more cycles before a stable release: 0.20 and then 1.0, both with a milestone/RC phase.

A stable 1.0 release will mean that core should not change until the next version in a binary-incompatible way - we have MiMA for that already set up. Other integration modules won't have this requirement as they depend on the integrations, so it would be hard to make any promises.

Hence - vote for the issues that you'd like fixed/implemented first and foremost, and let us know if you'd see any needs for breaking changes in core!

Changes since 0.19.0-M16

  • Mapping over errors in partial server endpoints (#1623) @adamw
  • Properly handle decode failures of both regular & security inputs (#1622) @adamw
  • use addSegment instead of addPath for http4s (#1621) @yurique
  • Improve how error output variants are defined: fix ordering, provide a method which allows arbitrary ordering (#1620) @adamw
  • Enables hiding endpoints with auth inputs if any inputs fails to decode (#1615) @adamw
  • ServerLog refactoring (#1598) @micossow
  • Improve refined integration for constraint on string size (#1613) @strokyl
  • Add swagger and redoc bundles, which allow interpreting and exposing docs in a single step (#1611) @adamw
  • Encode possible values when reporting an enumeraton error in the DefaultDecodeFailureHandler (#1608) @adamw
  • Add endpoint as a parameter to the OpenAPIDocsOptions (#1609) @adamw
  • Rename httpMethod to method and move to EndpointMetaOps (#1607) @adamw
  • Header values in Codec, codec naming cleanup (#1606) @adamw
  • Fix http4s WebSocket headers (#1601) @ghostdogpr

Dependency updates since 0.19.0-M16

v0.19.0-M16

10 Nov 21:11
Compare
Choose a tag to compare

Breaking changes

  • See the release notes for 0.19.0-M14
  • oneOfMapping is renamed to oneOfVariant (mostly with deprecations)

What’s Changed

Dependency updates

v0.19.0-M14

06 Nov 00:40
Compare
Choose a tag to compare

Breaking changes

This release brings some security improvements, most notably extending Endpoint with an additional type parameter A for security inputs.

More information on the change:

Migrating from previous versions:

  • replace any occurrence of the Endpoint type with PublicEndpoint
  • replace ServerEndpoint[I, E, O, R, F] with ServerEndpoint[R, F] (e.g. ServerEndpointp[Any, Future]), or with ServerEndpoint.Full[Unit, Unit, I, E, O, R, F] if you need to preserve the types of inputs/outputs
  • replace any calls to server interpreter which provided the endpoint and server logic separately, with a call to one of the .serverLogic variants. For example, AkkaHttpServerInterpreter().toRoute(helloWorld)(name => Future.successful(Right(s"Hello, $name!"))) should be replaced with AkkaHttpServerInterpreter().toRoute(helloWorld.serverLogicSuccess(name => Future.successful(s"Hello, $name!"))).

This should make the code compile using the new version. The next step would be to move security-related inputs from .in to .securityIn when defining the endpoint, and taking advantage of the security improvements (e.g. separate security and server logic).

What’s Changed

Dependency updates