v0.11.0: discriminated unions, shape ids accessible from schemas
- 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
- add header validator by @lewisjkl in #29
- Update smithy-aws-traits, smithy-model, ... to 1.16.1 by @scala-steward in #32
- Update smithy-aws-traits, smithy-model, ... to 1.16.2 by @scala-steward in #37
- add discriminated union trait by @lewisjkl in #30
- remove core dependency auto-add from sbt plugin by @lewisjkl in #38
- Update sbt-scalafix to 0.9.34 by @scala-steward in #39
- add id hints onto more generated types by @lewisjkl in #36
- Update scala-library, scala-reflect to 2.13.8 by @scala-steward in #46
- add flag to CI to trigger snapshot build by @lewisjkl in #45
- add support for transforms in codegen by @lewisjkl in #44
- Derive http endpoints from hints by @Baccata in #41
Full Changelog: v0.10.0...v0.11.0