v0.19.0-M1
0.19.0-M1
Note, better release notes will be included in the actual 0.19.0 final release, this is a summary from the changelog.
Move transform from algebra traits into extension methods
The transform method that used to be generated as a final def in the service algebras, is now available as an extension method. For Scala 2.12 compatibility, we generate an additional variant for F[_]-shaped instances and F[_, _]-shaped instances, in addition to the default one with F[_, _, _, _, _]. #1735
Add OptionalTag
Add OptionalTag trait and add the tag to Schema.OptionSchema to allow Option-like types to be efficiently created.
Add support for @alloy#preserveKeyOrder trait
Any map types that are annotated with @alloy#preserveKeyOrder will be rendered as a SeqMap in Scala 2.13+ and ListMap in Scala 2.12 instead of a Map so that key order is preserved.
Add MapTag
Add MapTag trait to allow creation of Map-like types to be efficiently created.
Unseal CollectionTag
Make CollectionTag just a trait instead of a sealed trait to allow third party libraries to implement their own CollectionTag so that collections
can be built efficiently. Existing and new usages of CollectionTags that start getting exhaustivity errors can handle unknown subtypes by using the CollectionTag instance's methods, such as iterator and fromIterator.
Documentation fix
Prevent documentation from being generated for case class when the field are not generated because they're annotated with @streaming
Reworked enumerations / the EnumerationSchema to eliminate a OOM pitfall and improve ergonomics of SchemaVisitor
Remove localhost from default URI in #1341
Previously, URIs constructed with a base URI of / would have localhost as the host. In some cases, that may not be desirable, such as in the case of frontend clients that want to reuse the window's origin. This is now fixed: hostnames are optional in the smithy4s URI model, and default to None.
Smart constructors for @adt union members have been renamed in #1370
Previously they'd be named after the member target, now they will use the name of the member itself (same as in the case of non-ADT unions).
Made EncoderK's second type parameter a type member in #1519
There's usually only one instance of EncoderK[F, A] for a particular F[_], and interpreters don't need to know what A is. For convenience, the type parameter has been moved to a type member.
Remove smithy4sRenderOptics setting from SBT and Mill plugins in #1566
Optics can still be rendered using metadata (global) and traits (selective), the only thing that's been removed is configuration in the build tool.
Removed UnknownErrorResponse in #1570
The error type smithy4s.http.UnknownErrorResponse has been replaced with smithy4s.http.RawErrorResponse, which provides a more accurate description of an error response that failed to decode, including a full representation of the response code, headers, body and the discriminator if one was found.
⚠️ Behavior Change: Handling of @default(null) and @nullable in #1667
The behavior of @default(null) has changed to better align with Smithy semantics.
-
With
@nullable:- Renders
smithy.api#defaultasDefault(Document.DNull). - Scala field uses
Nullablewith defaultNullable.Null.
- Renders
-
Without
@nullable:- Breaking change: previously generated non-optional Scala fields with type-specific defaults (e.g.,
0,false). - Now generates optional (
Option) fields without default. - Still renders
Default(Document.DNull)to preserve model fidelity.
- Breaking change: previously generated non-optional Scala fields with type-specific defaults (e.g.,
-
In smithy4s-core:
Document.DNullis interpreted asNullable.Nullwhen@nullableis present.- Otherwise, it's treated as the absence of a value.
Bijection does no longer extends Function in #1794
Prevents using it as an implicit conversion in Scala 2