Migrating
From 1.10.4 to 1.10.5
tapir-server-netty-loomhas been renamed totapir-netty-server-sync, and is availavble only for Scala 3. Use imports fromsttp.tapir.server.netty.sync, and start your server usingNettySyncServer(). See examples/HelloWorldNettySyncServer.scala for a full example.
From 1.9.3 to 1.9.4
NettyConfig.defaultNoStreaminghas been removed, useNettyConfig.default.
From 1.4 to 1.5
badRequestOnPathErrorIfPathShapeMatchesandbadRequestOnPathInvalidIfPathShapeMatcheshave been removed fromDefaultDecodeFailureHandler. These flags were causing confusion and incosistencies caused by specifics of ZIO and Play backends. Before tapir 1.5, keeping defaults (falseandtruerespectively for these flags) meant that some path segment decoding failures (specifically, errors - when an exception has been thrown during decoding, but not for e.g. enumeration mismatches) were translated to a “no-match”, meaning that the next endpoint was attempted. From 1.5, tapir defaults to a 400 Bad Request response to be sent instead, on all path decoding failures.If your code sets
badRequestOnPathErrorIfPathShapeMatches = trueto override the defaultfalse, you can just remove this in tapir 1.5, it is the new default.Similarly, if your code sets
.badRequestOnDecodeFailureon endpoint path input, just remove this attribute.If your code doesn’t change this parameter and you update tapir, you should expect shape-matched path decoding failures to always become 400s, without attempting the next endpoint unless explicitly specified.
If you want to override this behavior and force trying the next endpoint, add
.onDecodeFailureNextEndpointto the input where you expect such handling. See error handling page for details.
From 1.2 to 1.3
Static content endpoints from
sttp.tapir.static._are deprecated in favor of the newtapir-filesmodule. New methods are insttp.tapir.files._:staticFilesGetServerEndpoint,staticFilesHeadServerEndpoint,staticFilesServerEndpoints,staticResourcesGetServerEndpoint,staticResourcesHeadServerEndpoint,staticResourcesServerEndpoints, etc. See the updated documentation.Respectively, use
sttp.tapir.files.FilesOptionsinstead ofsttp.tapir.static.FilesOptionsthe
catsintegration module has been split intocatsandcats-effect, with the latter containing theCatsMonadErrorclass, providing a bridge between the sttp-internalMonadErrorand the cats-effectSynctypeclass. If you’ve been using this directly, you might need to update your dependencies.
From 0.20 to 1.0
EndpointVerifieris moved to a separatetapir-testingmodulecustomJsonBodyis renamed tocustomCodecJsonBodyanyFromStringBodyis renamed tostringBodyAnyFormatanyFromUtf8StringBodyis renamed tostringBodyUtf8AnyFormatCustomInterceptorsis renamed toCustomiseInterceptorsas this better reflects the functionality of the classCustomiseInterceptors.errorOutputis renamed to.defaultHandlers, with additional options added.in custom server interpreters, the
RejectInterecptormust be now disabled explicitly usingRejectInterceptor.disableWhenSingleEndpointwhen a single endpoint is being interpreted; theServerInterpreterno longer knows about all endpoints, as it is now parametrised with a function which gives the potentially matching endpoints, given aServerRequestthe names of Prometheus and OpenTelemetry metrics have changed; there are now three metrics (requests active, total and duration), instead of the previous 4 (requests active, total, response total and duration). Moreover, the request duration metric includes an additional label - phase (either headers or body), measuring how long it takes to create the headers or the body.
CustomiseInterceptors.appendInterceptoris replaced with.addInterceptor;.prependInterceptorand.appendInterceptormethods are also addedRequestHandler, returned byRequestInterceptor, now also accepts a list of server endpoints. This allows to dynamically filter the endpoints. Moreover, there’s a new type parameter inRequestInterceptorandRequestHandler,R, specifying the capabilities required by the given server endpoints.the http4s server interpreters have only one effect parameter, instead of two (
Ffor the general effect andGfor the body effect). This separation stopped making sense with the introduction ofBodyListenersome time ago and keepingServerInterpreterusing a single effect.the Swagger and Redoc UIs by default use relative paths for yaml/json documentation references and for redirects. This can be changed by passing appropriate options.
The
streamBinaryBodymethod now has a mandatoryformatparameter, which previously was fixed to beCodecFormat.OctetStream()
Moved traits, classes, objects
server interpreters & interceptors have moved from
coreinto theserver/coremoduleServerResponseandValuedEndpointOutputare moved tosttp.tapir.server.modelmetrics classes and interceptors have moved to the
sttp.tapir.server.metricspackageEndpoint.renderPathTemplateis renamed toEndpoint.showPathTemplateweb socket exceptions
UnsupportedWebSocketFrameExceptionandWebSocketFrameDecodeFailureare now in thesttp.tapir.modelpackageOpenAPI and AsyncAPI models are now part of a separate sttp-apispec project, hence the packages of these objects changed as well, from
sttp.tapir.apispec/sttp.tapir.openapi/sttp.tapir.asyncapitosttp.tapir.apispec.(...)server interpreters sources are now grouped based on the underlying server implementation (e.g. http4s, vertx), and then sub-directories contain effect integrations (e.g. cats, zio). Name templates:
for artifacts:
tapir-<server>-server-<effect>. E.g.tapir-zio-http4s-serverbecametapir-http4s-server-zio1for package names:
sttp.tapir.server.<server>.<effect>for interpreters:
<server><effect>ServerInterpreter
From 0.19 to 0.20
See the release notes
From 0.18 to 0.19
See the release notes
From 0.17 to 0.18
See the release notes