Releases: softwaremill/tapir
v0.19.0-M1
v0.18.0
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 Requestby default, if none is specified by the user, enumerating the reasons on why request decoding might fail. This can be turned off or adjusted inOpenAPIDocsOptions. - 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.SStringyou'll have to useSchemaType.SString()- server options have been significantly refactored. To create custom options, use e.g.
AkkaServerOptions.customInterceptors Validator.enummethod has been renamed toValidator.enumeration, and.derivedEnumto.derivedEnumeration, asenumis 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 toSchema.annotations. Instead ofderivedEndpointInput, usedEndpointInput.derivedinstead - 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 nowDefaultDecodeFailureHandler.handlerLogRequestHandling->ServerLogCodecis no longer aMapping- play server interpreter:
toRoute->toRoutes - deprecated
statusMappingin favor ofoneOfMapping - enumerations in openapi model (parameters, parameter style) are now sealed trait families
- schema improvements:
SObjectInfois replaced bySName; coproducts are more general, as they can include any child schemas (not only objects) - enums are referenced by default, there's no
referenceEnumsoption 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
- Update scala3-library to 3.0.1 (#1366) @scala-steward
- Update swagger-ui to 3.51.1 (#1363) @scala-steward
- Update vertx-web to 4.1.1 (#1353) @scala-steward
- Update client3:akka-http-backend, ... to 3.3.9 (#1352) @scala-steward
- Update jsoniter-scala-core, ... to 2.9.1 (#1350) @scala-steward
- Update jawn-parser to 1.2.0 (#1364) @scala-steward
- Update magnolia-core to 2.0.0-M9 (#1358) @scala-steward
- Update swagger-ui to 3.51.0 (#1355) @scala-steward
- Update derevo-core to 0.12.6 (#1346) @scala-steward
v0.17.20
What’s Changed
- circe updated to 0.14.1
v0.18.0-M18
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:
SObjectInfois replaced bySName; coproducts are more general, as they can include any child schemas (not only objects) - enums are referenced by default, there's no
referenceEnumsoption 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
- Update json4s-core, json4s-jackson to 4.0.1 (#1344) @scala-steward
- Update magnolia-core to 1.0.0-M4 (#1343) @scala-steward
- Update jsoniter-scala-core, ... to 2.9.0 (#1340) @scala-steward
- fixed docs generation of referenced enums when they're inside of a collection (#1341) @ae0n
- Fix instanceFromValues for case class with defined companion object (#1345) @mbore
- Named schemas (#1339) @adamw
- Missing components for AsyncAPI (#1338) @mbore
- Make authorizationUrl optional (#1342) @dvgica
- Setting options for AkkaHttpServerInterpreter as explicit parameter (#1321) @bartekzylinski
- Update scala3-library to 3.0.1-RC2 (#1334) @scala-steward
- Add test case for status code mappings with empty output with descrip… (#1332) @slabiakt
- Update enumeratum to 1.7.0 (#1331) @scala-steward
- Update client3:akka-http-backend, ... to 3.3.7 (#1330) @scala-steward
v0.18.0-M17
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.enummethod has been renamed toValidator.enumeration, and.derivedEnumto.derivedEnumeration, asenumis 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
- #1317 fix http4s swagger contextPath for multi path part (#1318) @stsatlantis
- fixed referencing enums for optional fields (#1327) @ae0n
- Use URLEncoder.encode() for paths rendering (#1325) @slabiakt
- Add Shadowed Endpoints Checker functionality (#1301) @slabiakt
- Update scala-logging to 3.9.4 (#1322) @scala-steward
- Update scalacheck-toolbox-datetime to 0.6.0 (#1320) @scala-steward
- Enable more projects for scala3 (#1315) @adamw
- Update magnolia-core to 2.0.0-M8 (#1316) @scala-steward
- Scala3 (#1204) @adamw
- Update OpenapiCodegenTask.scala (#1312) @kastoestoramadus
- Update sbt-scalajs, scalajs-library, ... to 1.6.0 (#1299) @scala-steward
- fix(http4s-client): exclude empty query params from URI (#1308) @MichalPawlicki
- Use proper types in openapi docs for example and enum values (#1311) @adamw
- fix core tests (#1310) @mbore
- Adapt oneOfUsingField (#1309) @mbore
- Update akka-stream to 2.6.15 (#1307) @scala-steward
- Schema derivation configuration (#1304) @mbore
- Update opentelemetry-api, ... to 1.3.0 (#1305) @scala-steward
- adapt MatchType macro (#1287) @mbore
- Add fix for explicit content-type header priority issue (#1297) @slabiakt
- Update upickle to 1.4.0 (#1298) @scala-steward
- Update swagger-ui to 3.50.0 (#1294) @scala-steward
- Update sbt-assembly to 1.0.0 (#1296) @scala-steward
- fix: 🐛 #1272 Allow exposing Swagger on a non-root route (#1295) @gaeljw
v0.18.0-M15
What’s Changed
- Update zio, zio-streams, zio-test, ... to 1.0.9 (#1290) @scala-steward
- Update client3:akka-http-backend, ... to 3.3.6 (#1291) @scala-steward
- Update aws-lambda-java-runtime-interface-client to 1.1.0 (#1292) @scala-steward
- Revert "Update catbird-effect, catbird-finagle to 21.5.0" (#1293) @adamw
- Update catbird-effect, catbird-finagle to 21.5.0 (#1289) @scala-steward
- Update jawn-parser to 1.1.2 (#1286) @scala-steward
- Update circe-yaml to 0.14.0 (#1285) @scala-steward
- Update vertx-web to 4.1.0 (#1288) @scala-steward
- Update jawn-parser to 1.0.3 (#1284) @scala-steward
- Update refined to 0.9.26 (#1273) @scala-steward
- Update http4s-blaze-client, ... to 0.21.24 (#1275) @scala-steward
- Update circe-core, circe-generic, ... to 0.14.1 (#1274) @scala-steward
- Fixes oneOf with empty body openapi spec generation (#1281) @Paulymorph
- Update scala-compiler, scala-library, ... to 2.12.14 (#1279) @scala-steward
- Update tethys-core, tethys-derivation, ... to 0.24.0 (#1277) @scala-steward
- Tapir aws (#1226) @kubinio123
- Update simpleclient_common to 0.11.0 (#1282) @scala-steward
- Update vertx-web to 4.1.0.CR2 (#1278) @scala-steward
- Update zio-interop-cats to 3.1.1.0 (#1269) @scala-steward
- Update sbt-mima-plugin to 0.9.2 (#1268) @scala-steward
- Update jsoniter-scala-core, ... to 2.8.2 (#1258) @scala-steward
- Update zio-interop-cats to 2.5.1.0 (#1259) @scala-steward
- Update json4s-core, json4s-jackson to 4.0.0 (#1267) @scala-steward
- Update client3:akka-http-backend, ... to 3.3.5 (#1266) @scala-steward
- Update vertx-web to 4.1.0.CR1 (#1262) @scala-steward
- Update swagger-ui to 3.49.0 (#1261) @scala-steward
- Update zio-json to 0.1.5 (#1260) @scala-steward
- Openapi convenience (#1230) @hamnis
- Update shared:akka, shared:core, ... to 1.2.5 (#1252) @scala-steward
- Update upickle to 1.3.15 (#1251) @scala-steward
- Use early-semver versioning scheme, add MiMa and sbt-dynver (#1129) @majk-p
- Update zio, zio-streams, zio-test, ... to 1.0.8 (#1250) @scala-steward
- Update cats-effect to 2.5.1 (#1233) @scala-steward
- Update mdoc, sbt-mdoc to 2.2.21 (#1234) @scala-steward
- Update scalatest to 3.2.9 (#1238) @scala-steward
- Update client3:akka-http-backend, ... to 3.3.3 (#1240) @scala-steward
- Update discipline-scalatest to 2.1.5 (#1243) @scala-steward
- Update upickle to 1.3.14 (#1245) @scala-steward
- Revert "Upgrade to OpenAPI 3.1.0" (#1247) @adamw
- Upgrade to OpenAPI 3.1.0 (#1223) @rojekp
- Update http4s-blaze-client, ... to 0.21.23 (#1246) @scala-steward
- Update scala-java-time, ... to 2.3.0 (#1244) @scala-steward
- Update model:core to 1.4.7 (#1241) @scala-steward
- Update upickle to 1.3.13 (#1236) @scala-steward
- Update shared:akka, shared:core, ... to 1.2.4 (#1237) @scala-steward
- Update refined to 0.9.25 (#1235) @scala-steward
- Update cats-core, cats-laws to 2.6.1 (#1232) @scala-steward
- Update sbt-mima-plugin to 0.9.1 (#1231) @scala-steward
- Update client3:akka-http-backend, ... to 3.3.2 (#1229) @scala-steward
- Update model:core to 1.4.6 (#1215) @scala-steward
- Update client3:akka-http-backend, ... to 3.3.1 (#1221) @scala-steward
- Update jsoniter-scala-core, ... to 2.8.1 (#1224) @scala-steward
- Update opentelemetry-api, ... to 1.2.0 (#1222) @scala-steward
v0.18.0-M11
What’s Changed
- Openapi convenience (#1230) @hamnis
- Update shared:akka, shared:core, ... to 1.2.5 (#1252) @scala-steward
- Update upickle to 1.3.15 (#1251) @scala-steward
- Use early-semver versioning scheme, add MiMa and sbt-dynver (#1129) @majk-p
- Update zio, zio-streams, zio-test, ... to 1.0.8 (#1250) @scala-steward
- Update cats-effect to 2.5.1 (#1233) @scala-steward
- Update mdoc, sbt-mdoc to 2.2.21 (#1234) @scala-steward
- Update scalatest to 3.2.9 (#1238) @scala-steward
- Update client3:akka-http-backend, ... to 3.3.3 (#1240) @scala-steward
- Update discipline-scalatest to 2.1.5 (#1243) @scala-steward
- Update upickle to 1.3.14 (#1245) @scala-steward
- Revert "Upgrade to OpenAPI 3.1.0" (#1247) @adamw
- Upgrade to OpenAPI 3.1.0 (#1223) @rojekp
- Update http4s-blaze-client, ... to 0.21.23 (#1246) @scala-steward
- Update scala-java-time, ... to 2.3.0 (#1244) @scala-steward
- Update model:core to 1.4.7 (#1241) @scala-steward
- Update upickle to 1.3.13 (#1236) @scala-steward
- Update shared:akka, shared:core, ... to 1.2.4 (#1237) @scala-steward
- Update refined to 0.9.25 (#1235) @scala-steward
- Update cats-core, cats-laws to 2.6.1 (#1232) @scala-steward
- Update sbt-mima-plugin to 0.9.1 (#1231) @scala-steward
- Update client3:akka-http-backend, ... to 3.3.2 (#1229) @scala-steward
- Update model:core to 1.4.6 (#1215) @scala-steward
- Update client3:akka-http-backend, ... to 3.3.1 (#1221) @scala-steward
- Update jsoniter-scala-core, ... to 2.8.1 (#1224) @scala-steward
- Update opentelemetry-api, ... to 1.2.0 (#1222) @scala-steward
- feat(openapi): provide default 400 responses in docs (#1153) @MichalPawlicki
- Update jsoniter-scala-core, ... to 2.8.0 (#1219) @scala-steward
- Update sbt-mima-plugin to 0.9.0 (#1217) @scala-steward
- Fix test issue #1169 (#1214) @danilbykov
v0.18.0-M10
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
- feat(openapi): provide default 400 responses in docs (#1153) @MichalPawlicki
- Update jsoniter-scala-core, ... to 2.8.0 (#1219) @scala-steward
- Update sbt-mima-plugin to 0.9.0 (#1217) @scala-steward
- Fix test issue #1169 (#1214) @danilbykov
v0.18.0-M9
What’s Changed
- opentelemetry default metrics (#1209) @kubinio123
- [#1032] Added mock server integration (#1097) @vitaliihonta
- Update scalacheck to 1.15.4 (#1213) @scala-steward
- Update swagger-ui to 3.48.0 (#1210) @scala-steward
v0.18.0-M8
What’s Changed
- TapirFile instead of SttpFile (#1208) @kubinio123
- add zio-json support (#1197) @endertunc
- observability for endpoints (#1151) @kubinio123
- Update jsoniter-scala-core, ... to 2.7.3 (#1207) @scala-steward
- Update derevo-core to 0.12.5 (#1206) @scala-steward
- Update upickle to 1.3.12 (#1205) @scala-steward
- Update client3:akka-http-backend, ... to 3.3.0 (#1202) @scala-steward
- Update model:core to 1.4.5 (#1201) @scala-steward
- Update discipline-scalatest to 2.1.4 (#1200) @scala-steward
- Asyncapi extensions (#1189) @danielleontiev
- Fix ZIO issues (#1195) @PawelJ-PL
- stub server endpoint (#1193) @kubinio123
- Update client3:akka-http-backend, ... to 3.3.0-RC5 (#1194) @scala-steward
- Raw value tmp files (#1182) @kubinio123
- Update model:core to 1.4.4 (#1188) @scala-steward
- Update zio-interop-cats to 2.4.1.0 (#1184) @scala-steward
- Update cats-core, cats-laws to 2.6.0 (#1179) @scala-steward
- Update shared:akka, shared:core, ... to 1.2.2 (#1178) @scala-steward
- Update swagger-ui to 3.47.1 (#1177) @scala-steward
- Update zio, zio-streams to 1.0.7 (#1191) @scala-steward
- Update scala-java-time, ... to 2.2.2 (#1190) @scala-steward
- Update refined to 0.9.24 (#1187) @scala-steward
- Update scalatest to 3.2.8 (#1185) @scala-steward
- Update client3:akka-http-backend, ... to 3.3.0-RC4 (#1183) @scala-steward
- Update mdoc, sbt-mdoc to 2.2.20 (#1181) @scala-steward
- Update cats-effect to 2.5.0 (#1180) @scala-steward
- Update jsoniter-scala-core, ... to 2.7.2 (#1176) @scala-steward