Releases: disneystreaming/smithy4s
v0.16.2 - more Scala Native support, fix AWS timestamp issue
In this release, we've added support for Scala Native in the http4s integration module, as well as the (still experimental) AWS modules. This is thanks to the work of @armanbilge et al. on bringing the Typelevel world closer to the Native world.
Additionally, a regression in timestamp formatting for AWS has been fixed (#471), so your JVM/JS/Native apps should be able to talk to (a subset of) AWS services again. Give it a try!
What's Changed
- Update sbt-scalafix to 0.10.2 by @scala-steward in #466
- Native Http4s by @kubukoz in #470
- Fix AWS timestamp formats by @kubukoz in #471
Full Changelog: v0.16.1...v0.16.2
v0.16.1: Sharing specs, Mill support & more
NOTE: Use 0.16.1 not 0.16.0, the latter is a botched release that only contains a subset of the changes.
This release is huge! Thanks to all the contributors.
The 0.16.1 release breaks both source and binary compatibility.
At a high level, here are the changes you can look forward to in the release:
Support for the @httpResponseCode trait - #377
You can mark a member of your output
structure with @httpResponseCode
and expect smithy to use that value when rendering a http response, on the server, or to fill that value from the response status code, on the client.
Support for sharing specifications across modules (sbt or mill) (similar to how you depend on another module Scala code in sbt
with the dependsOn
setting) - #432
Multiple people came naturally to this kind of project setup where you have multiple module and you may want to have common code and specification live a given module that your other modules depends on. With this release, it's totally doable. See this page for more information
Mill support - #450
Now your mill modules can also use Smithy4s code generation. See this page for more information.
Decline integration is effect-agnostic - #429
Previous version use CommandIOApp
which requires cats.effect
. 0.16.1
version will allow you to use the effect system of your choice.
Builder pattern to create your clients - #447
New API looks like:
SimpleRestJsonBuilder(HelloWorldService)
.client(client)
.uri(Uri.unsafeFromString("http://localhost:9000"))
.resource
More details below.
What's Changed
- Change mima target (0.16) by @daddykotex in #417
- httpResponseCode handling (server side) by @daddykotex in #377
- Update jsoniter-scala-core to 2.17.2 by @scala-steward in #445
- support root imports in refinements by @lewisjkl in #442
- Use a document relative url for specs by @daddykotex in #444
- Fix collision by @yisraelU in #451
- Update flake.lock by @kubukoz in #454
- 0.16.0 merge by @daddykotex in #460
Full Changelog: v0.15.3...v0.16.1
v0.15.3 - bug fixes, customization for default rendering
This release brings several fixes to bugs we've found in the previous ones. Notable changes:
Allow customizing the rendering of default values (#414)
This adds the ability to change how default values appear in the generated sources. Take a look at the documentation for more!
Fixes to defaults in mixins - #423, #425
Fixes some issues that you could encounter in situations where you're generating code for a structure with default values inherited from a mixin.
Collision detection #412
Fixes some issues with code generation where a name conflicts with the Scala standard library.
Exhaustively capture the codegen input for cache invalidation #438
Helps avoid the issues where codegen wouldn't be triggered after the inputs are changed.
Other changes
- Fix mima command to run more quickly by @lewisjkl in #415
- Bump prism-react-renderer from 1.3.1 to 1.3.5 in /modules/website by @dependabot in #401
- Bump clsx from 1.1.1 to 1.2.1 in /modules/website by @dependabot in #407
- Update jsoniter-scala-core to 2.16.0 by @scala-steward in #416
- Update nscplugin, sbt-scala-native, ... to 0.4.6 by @scala-steward in #427
- Update jsoniter-scala-core to 2.17.0 by @scala-steward in #418
- Update nscplugin, sbt-scala-native, ... to 0.4.7 by @scala-steward in #436
- Bump Scala 3 to 3.2.0 by @Baccata in #437
- Update smithy-aws-traits, smithy-build, ... to 1.24.0 by @scala-steward in #428
- Bump docusaurus-lunr-search from 2.1.16 to 2.2.0 in /modules/website by @dependabot in #426
- Update fs2-core to 3.2.14 by @scala-steward in #440
Full Changelog: v0.15.2...v0.15.3
v0.15.2 - CLI module, bugfixes, dynamic module improvements
This release adds a new module - decline
- providing integration with the Decline library. It provides the ability to easily get a command line interface for any service implementation or client.
Additionally, the release fixes a couple bugs like #389, as well as adding support for Smithy 2.0 enum
and intEnum
shapes in the Dynamic module.
This release enables a previously disabled feature of the http4s clients&servers (as well as other code using the json
module's codec support) - encoding intEnum
as a JSON number.
Finally, MiMa checks have been enabled, so we'll track binary compatibility more seriously in future releases.
Full changelog
- Update smithy-aws-traits, smithy-build, ... to 1.23.1 by @scala-steward in #388
- Small typo in
01-overview.md
by @zetashift in #390 - Collision Avoidance additions by @yisraelU in #393
- Range collision avoidance by @yisraelU in #394
- Auto-update GitHub Action dependencies by @IdiosApps in #395
- Revert "Range collision avoidance" by @yisraelU in #396
- Bump actions/upload-artifact from 2 to 3 by @dependabot in #397
- Bump actions/checkout from 2 to 3 by @dependabot in #398
- Bump actions/download-artifact from 2 to 3 by @dependabot in #399
- Add support for decline interpreters by @yisraelU in #376
- Bump @docusaurus/core from 2.0.0-beta.14 to 2.0.1 in /modules/website by @dependabot in #403
- Enable Mima Checks by @lewisjkl in #408
- Bump @docusaurus/preset-classic from 2.0.0-beta.14 to 2.0.1 in /modules/website by @dependabot in #400
- Dynamic smithy4s enums + allow IntEnum hint in JSON codecs by @daddykotex & @kubukoz in #406
- Update http4s-circe, http4s-client, ... to 0.23.15 by @scala-steward in #409
- Update 04-deriving-cli.md by @yisraelU in #410
- Bump docusaurus-lunr-search from 2.1.15 to 2.1.16 in /modules/website by @dependabot in #404
- Update 04-deriving-cli.md by @yisraelU in #411
New Contributors
- @zetashift made their first contribution in #390
- @IdiosApps made their first contribution in #395
- @dependabot made their first contribution in #397
Full Changelog: v0.15.1...v0.15.2
v0.15.1 - Initialization bug fix
Following the introduction of refinements a bug slipped in. It's a tricky one that only shows up at runtime, under some conditions. See #383 and related PR for more info.
What's Changed
- Refer to the job name, not the steps by @daddykotex in #381
- Update swagger-ui-dist to 4.14.0 by @scala-steward in #380
- fix init ordering bug by @lewisjkl in #385
Full Changelog: v0.15.0...v0.15.1
v0.15.0 : Smithy 2.0 support, custom type refinements
The 0.15.0 release breaks both source and binary compatibility
This is a very exciting release for us, as it makes Smithy4s compatible with Smithy 2.0
Highlights
Adds support for smithy 2.0, which brings a number of very interesting features. In particular :
- mixins, which allow to drastically DRY your specifications when multiple shapes share a number of elements
- defaults, which allow to specify default values for the fields of your structure types
- enums/int enums, which make enumerations a lot nicer to write/read in smithy
Adds support for custom refinements
This provides a mechanism for the user to plug some datatypes of their own in the generated code. These can be validated against
user-defined rules, via an implicit instance provided by the user (or a third party). Smithy4s forces this customisation to be driven by smithy traits, which allow specifications to retain a formally-indicative nature of the behaviour of APIs. These refinements are wired in all decoding logic exercised by smithy4s, which means they are taken into account whether the data is found in headers, query parameters, path parameters, or bodies of the http requests/responses.
See the documentation for more details.
Better collision avoidance in the rendered code
Some care has been put in the generated code to facilitate collision avoidance between what exists and what is generated, without relying on fully-qualified-names by default. Although there may still be edge cases, this approach means the generated code retains a reasonably pleasant-to-read nature, which we have found to be important to users.
Fixes
- When the
@jsonName
trait is used on structure members, potential error messages should expose the correct expectations - Fixes an issue that would lead clients to decode error payloads as the wrong error type
What's Changed
- Add type annotation to list of endpoints by @kubukoz in #323
- adds doc search by @yisraelU in #326
- Update smithy-aws-traits, smithy-build, ... to 1.22.0 by @scala-steward in #325
- Reduce CPU usage on access to java.util.HashTable by @plokhotnyuk in #327
- Update cats-effect to 3.3.14 by @scala-steward in #324
- Update 02-unions.md by @yisraelU in #335
@errorMessage
trait by @kubukoz in #320- Update jsoniter-scala-core to 2.13.37 by @scala-steward in #334
- Update jsoniter-scala-core to 2.13.38 by @scala-steward in #342
- Update weaver-cats, weaver-scalacheck to 0.6.14 by @scala-steward in #340
- Update http4s-circe, http4s-client, ... to 0.23.14 by @scala-steward in #344
- Update scala-collection-compat to 2.8.1 by @scala-steward in #345
- Update fs2-core to 3.2.11 by @scala-steward in #339
- add middleware example docs by @lewisjkl in #343
- Revise bijection surjection by @lewisjkl in #351
- Update jsoniter-scala-core to 2.13.39 by @scala-steward in #349
- Update to smithy 2.0; add int enum support by @lewisjkl in #352
- Update jsoniter-scala-core to 2.14.0 by @scala-steward in #353
- Update swagger-ui-dist to 4.13.2 by @scala-steward in #350
- Update jsoniter-scala-core to 2.14.1 by @scala-steward in #356
- first pass at using mixins to create traits by @lewisjkl in #355
- Best-effort error-decoding fix by @Baccata in #357
- Update weaver-cats, weaver-scalacheck to 0.7.15 by @scala-steward in #362
- Update jsoniter-scala-core to 2.14.2 by @scala-steward in #360
- Update fs2-core to 3.2.12 by @scala-steward in #359
- Smithy 2.0 syntax is released in the 1.23.0 artifact by @Baccata in #364
- Update jsoniter-scala-core to 2.15.0 by @scala-steward in #367
- Collision detection by @yisraelU in #366
- DocumentKeyDecoder and DocumentKeyEncoder by @daddykotex in #311
- Use jsonName on Missing required field error by @daddykotex in #371
- Build checkpoint for mergify by @daddykotex in #373
- Add the logic to render default parameters by @Baccata in #374
- Backported jsonName fixes by @daddykotex in #375
- Change checks conditions and command by @Baccata in #378
- add default support in several locations by @lewisjkl in #358
- Series 0.15.0 mega PR by @Baccata in #379
Full Changelog: v0.14.2...v0.15.0
v0.14.2: more efficient parsing of json objects/arrays
Highlights :
- More efficient parsing of json objects/arrays. As usual, kudos to @plokhotnyuk for his amazing work on optimising the json parsing.
- It's now easier to set up smithy4s in other SBT configurations than
Compile
. See here
What's Changed
- Make it easier to enable codegen in configurations other than Compile by @kubukoz in #310
- Update decline to 2.3.0 by @scala-steward in #312
- Update sbt-scalajs, scalajs-compiler, ... to 1.10.1 by @scala-steward in #315
- Update http4s-circe, http4s-client, ... to 0.22.14 by @scala-steward in #313
- Update scala-collection-compat to 2.8.0 by @scala-steward in #318
- Update sbt, sbt-dependency-tree to 1.7.1 by @scala-steward in #319
- Update scala-library, scala-reflect to 2.12.16 by @scala-steward in #316
- More efficient parsing of JSON arrays and objects by @plokhotnyuk in #322
Full Changelog: v0.14.1...v0.14.2
v0.14.1: bug fix (swagger-ui)
Fixes a bug that would lead callers to get 404'd on the default swagger-ui path.
What's Changed
Full Changelog: v0.14.0...v0.14.1
v0.14.0: Scala-native support, improvements across the board
The 0.14.0 release breaks binary compatibility, as well as source compatibility (in a few places) with the previous versions.
It does however achieves a number of significant improvements across the boards, in terms of user experience, performance and maintainability.
Special thanks to @plokhotnyuk, @schmeedy, @yisraelU, @daddykotex
Highlights
- The core/json/dynamic modules are now published for scala-native (scala 3 only for the time being)
- The http4s-swagger-ui module has received an overhaul, in order to avoid relying on a javascript function that presented a security issue, but also to allow for users to easily serve several specifications at the same time.
- Having union members target the
Unit
shape now leads to the corresponding type be rendered as a case object in Scala. - A mechanism was added for users to be able to opt-in
Vector
andIndexedSeq
Scala types when using smithylist
shape. - The
Timestamp
construct was overhauled to unify its modelling across the different platforms, and received a massive performance improvement for parsing/serialising. - Modified the SBT plugin to have SBT pre-fetch the artifacts before calling the Smithy4s code-generation, making it more respectful to other settings (such as repository credentials)
- The
smithy4s.schema.Schema
construct was reworked to unify the collections under a common abstraction, and thesmithy4s.schema.SchemaVisitor
construct was also changed to reduce the likelihood of a common mistake related to memoisation of union encoders .
What's Changed
- Add a first iteration containing documentation of design. by @Baccata in #257
- Remove smithy files from package by @yisraelU in #285
- Refactoring of Timestamp by @plokhotnyuk in #283
- Couple ShapeTag with Schema by @Baccata in #271
- Change the Field and Alt model to not hold schemas anymore by @Baccata in #279
- Fix path url decoding by @kubukoz in #284
- Use internal sbt dependency resolution in codegen-plugin by @schmeedy in #288
- Improve swagger docs support by @daddykotex in #287
- Update copyright notices by @daddykotex in #292
- Document library dependency feature by @Baccata in #291
- Document the design of the Service and Endpoint interfaces by @Baccata in #282
- Rework of the concept of collection in the Schema abstraction by @daddykotex in #290
- Scala native support by @Baccata in #289
- Optimize serialization for ArraySeq by @plokhotnyuk in #297
- Render Unit in unions as case objects by @Baccata in #294
- Update fs2-core to 3.2.10 by @scala-steward in #299
- Update weaver-cats, weaver-scalacheck to 0.7.13 by @scala-steward in #301
- Update sbt-scalafix to 0.10.1 by @scala-steward in #298
- Update weaver-cats, weaver-scalacheck to 0.6.13 by @scala-steward in #300
- Implement a simple SchemaDescription visitor by @daddykotex in #295
- Revises the "union" method in SchemaVisitor ... by @Baccata in #302
- Replace schematic implementation by schema visitor by @daddykotex in #296
- Add enum value names by @kubukoz in #304
- Update jsoniter-scala-core to 2.13.36 by @plokhotnyuk in #305
- Add
@vector
and@indexedSeq
by @daddykotex in #303
New Contributors
Full Changelog: v0.13.7...v0.14.0
v0.13.7 : fix unused import
Highlights :
- Fix an issue that would lead to unused imports being rendered when the input of an operation has a collection member from another namespace.
- Fix a potential resource leak in the EC2/ECS AWS credentials provider
What's Changed
- Switch weaver to munit in core Module. by @Baccata in #277
- Fix resource leak in AWS refresh loop by @kubukoz in #278
- fix imports for newtypes from other packages by @lewisjkl in #280
Full Changelog: v0.13.6...v0.13.7