Skip to content

v0.11.0: discriminated unions, shape ids accessible from schemas

Compare
Choose a tag to compare
@Baccata Baccata released this 14 Jan 12:01
56843ea
  • the SBT plugin does not automatically add a dependency to smithy4s-core anymore. This was creating problems with regards to scala-js. The dependency has to be manually added now, if you want to compile the generated code without any further integration.
  • Adds a @discriminated trait, to communicate that unions should be encoded using discriminator fields. This facilitates porting some API specs from openapi
  • ShapeIds are now rendered and made part of the Schema's hints for all shapes. This can be used for the implementation of protocols, or to communicate better errors during decoding failures.
  • Adds support for transformations in code generation. Smithy4s will load [ProjectionTransformers] from the classpath during the code generation process, and will apply all transformations, the names of which are listed in the smithy4sModelTransformers SBT setting. This can be useful to pre-process models automatically before code-generating.
  • Http-specific rendering logic has now been removed, in favour of a Schematic implementation that derives the same information from traits. This effectively makes smithy4s's rendered code 100% protocol agnostic, and opens the door for interesting features.

What's Changed

Full Changelog: v0.10.0...v0.11.0