Skip to content

Releases: disneystreaming/smithy4s

v0.18.10 : update alloy to 0.3.1

28 Feb 14:23
8cb01fd
Compare
Choose a tag to compare

Updated alloy to 0.3.1. This warrants a release because of this change, which smithy4s leverages to let @nullable hints through when compiling interpreters, which impacts serialisation.

Without this upgrade, the SimpleRestJsonBuilder doesn't know that nullable should be taken into consideration, and filters the corresponding hints out before compiling the schema into json codecs.

What's Changed

Full Changelog: v0.18.9...v0.18.10

v0.18.9 : support for alloy#nullable

27 Feb 14:13
9f2dbcb
Compare
Choose a tag to compare

Features

Support for alloy#nullable

This release adds support for alloy#nullable. This trait can be used to signal the fact that the absence of value in a serialised payload and the presence of an explicit null value in a similar payload have different meanings. In particular, this is useful in the case of json-merge-patch, where null denotes that a value ought to be removed, and the absence of value denotes that a value ought to stay the same.

See https://github.com/disneystreaming/smithy4s/pulls?q=is%3Apr+is%3Aclosed

Allow for customising whether XML attributes should be escaped during serialisation

AWS protocols escape xml attributes to be escaped. However, the fact that XML attributes are quoted implies that the escaping is not always necessary. In some usecases (notably ivy.xml), the escaping results in invalid payloads. Therefore, an option is added to customise the behaviour, and the default is now set to non-escaped XML attributes.

See #1410

Other

New Contributors

Full Changelog: v0.18.8...v0.18.9

v0.18.8

06 Feb 20:34
cddd682
Compare
Choose a tag to compare

What's Changed

Allows constructing refinement schemas manually in more flexible ways than before.

  • [codegen] add scala 3 keywords to collision avoidance by @jpassaro in #1392

Fixes the collision avoidance algorithm to cover Scala 3 keywords.

Other changes

New Contributors

Full Changelog: v0.18.7...v0.18.8

v0.18.7

29 Jan 16:32
7471124
Compare
Choose a tag to compare

What's changed

Added support for @httpResponseCode on newtypes (integer shapes that aren't exactly smithy.api#Integer), as well as refinements (e.g. ints with a @range constraint).

Other changes

Full Changelog: v0.18.6...v0.18.7

v0.18.6

19 Jan 19:43
2a5007a
Compare
Choose a tag to compare

What's Changed

  • If a Smithy trait, being a structure shape, had a Scala keyword in its member names, compilation of the generated would fail. In addition, enumeration values that matched a known keyword would have their name erroneously escaped with an underscore in the string literal.
    These are now fixed in #1344 by @kubukoz.

  • Smithy4s specific logic to extract manifest from jars should not run on jar. Fixed in #1351 by @daddykotex.

  • In some concurrent scenarios, especially those of concurrent initialization of objects (e.g. tests), your application would previously be at risk of deadlocking due to #537. This is now fixed by suspending evaluation of hints in companion objects using the .lazily construct: see #1326 by @kubukoz.

  • Allow to configure how the default values (and nulls for optional fields) are rendered. Fixed in #1315 by @msosnicki.

Dependency updates and other internal changes

New Contributors

Full Changelog: v0.18.5...v0.18.6

v0.18.5 : x-www-form-urlencoded bug fix

03 Jan 08:38
cebdd43
Compare
Choose a tag to compare

This releases fixes a bug related to default values in the x-www-form-urlencoded encoding.

See #1323

What's Changed

Full Changelog: v0.18.4...v0.18.5

v0.18.4

02 Jan 17:22
v0.18.4
282aa90
Compare
Choose a tag to compare

This release fixes a bunch of bugs and introduces some minor semantic changes. Make sure to review them!

What's Changed

Update meaning of required in both codegen and runtime by @Baccata in #1301

Adjusts the behavior of required fields with defaults. Most importantly, it changes the behavior when the following conditions are all true:

  • @required is present on a member
  • @default (or = shorthand) is present on that member
  • the runtime value matches the default

e.g. @required s: String = "foo" with a runtime value of "foo".

In past releases, JSON codecs would not write such fields when serializing your data, unless configured to do so with the withExplicitDefaultsEncoding option. Starting with this release, @required fields will always be serialized in JSON, Documents and XML (as well as any other codecs that use getUnlessDefault or foreachUnlessDefault).

This isn't yet fixed in AWS ec2Query codecs. A fix is in the works.

Additional changelog information

Changes the behaviour of Field#getUnlessDefault and Field#foreachUnlessDefault to always take the value into consideration when the smithy.api#required trait is present on the field. This leads to field values being always serialised even when their values match their defaults, as this abides by least-surprise-principle.

Fix LSP rendering of the repository by @daddykotex in #1293

Fixes sbt's and mill's rendering of Maven repositories in smithy4sUpdateLSPConfig and smithy4s.codegen.LSP/updateConfig, respectively.

Avoid duplicate repos/deps/imports in the smithy-build.json by @daddykotex in #1299

In some cases, it was possible that using the LSP config tasks in sbt/mill would result in a repository appearing on the list more than once. This fix removes such duplication.

AwsCredentialsProvider should allow Instance Metadata Service base URI to be overridden using environment variable by @bpholt in #1306

Adds the ability to configure the base URI of the AWS Metadata Service with the AWS_EC2_METADATA_SERVICE_ENDPOINT variable, which is consistent with some official AWS SDKs.

Escape astrisks following slashes in documentation by @bpholt in #1304

Add support for Unit primitives when unfolding typed nodes by @denisrosca in #1325

Fixes an issue (#1297) in which Unit values couldn't be rendered in Smithy traits.

Fixes an issue (#1296) in which the code generator would fail with a stack overflow when rendering some recursive traits.

Library updates and internal changes

New Contributors

Full Changelog: v0.18.3...v0.18.4

v0.18.3

03 Nov 10:32
45970f5
Compare
Choose a tag to compare

v0.18.3 : misc fixes

  • Support constraint traits on members targeting enums

Although it's weird to allow it, it is actually supported in Smithy.

  • Tweak operation schema *Input and *Output functions

Some schema visitor will adjust their behaviour if a shape is the input or the output of an operation. For this reason we have a InputOutput class with a Input and Output hint that you can add to schemas to adjust the behaviour. OperationSchema has functions to work on input schemas and output schemas of an operation. This change makes these functions automatically add the relevant hint.

See #1284

  • OptionDefaultVisitor supports bijection

When the schema for the member of a structure is a bijection, and the structure is meant to be decoded from metadata (like http headers), optionality was disregarded. This was making optional member required when decoding.

See #1284

  • Fixing AwsInstanceMetadata codec in #1266

Resolves an issue in which AWS credentials would be decoded using the wrong timestamp format, affecting AWS clients on EC2/ECS.

See #1266

  • Render explicit type annotations for some methods that were missing them in #1272

This resolves a problem in which type inference would have different results between Scala 2.13 and 3.x, causing an error on Scala 2.13 under the -Xsource:3 flag.

See #1272

  • Override toString on error shapes

Default toString implementation on Throwable prints the class name, instead, we decided to rely on a custom toString implementation.

See #1263

What's Changed

Full Changelog: v0.18.2...v0.18.3

v0.18.2 - UrlForm encapsulation improvements

10 Oct 22:59
410478e
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.18.1...v0.18.2

v0.18.1 : bug fixes

09 Oct 08:18
9a46b36
Compare
Choose a tag to compare

0.18.1

Open enum support in Dynamic module

In 0.18.0, support was added for open enums in smithy4s-generated code. This release extends that support to runtime (dynamic) schemas.

Fixed a bug preventing a model pre-processor from being exercised

This model-preprocessor aims at removing constraints from output types in AWS specs (as AWS doesn't seem to respect said constraints)
#1251

What's Changed

Full Changelog: v0.18.0...v0.18.1