Releases: disneystreaming/smithy4s
v0.18.11 : original field ordering in schemas / alloy.proto
This release contains the following noteworthy items :
- Structure schemas are now abiding by the original field order from the spec. This detail finds its importance in some protocols.
- Shapes defined in the
alloy.proto
namespace are now code-generated and packaged with smithy4s-core. - A new schema combinator,
transformTransitivelyK
, is now present, facilitating some schema transformations.
What's Changed
- Update alloy-core, alloy-openapi, ... to 0.3.2 by @scala-steward in #1429
- Update jsoniter-scala-macros to 2.28.3 by @scala-steward in #1431
- Add transformTransitivelyK by @kubukoz in #1426
- Update sbt-projectmatrix to 0.10.0 by @scala-steward in #1430
- Update sbt-scalafix to 0.12.0 by @scala-steward in #1428
- Retain original field ordering in schemas by @Baccata in #1427
- Enable code generation of alloy.proto in core by @Baccata in #1432
Full Changelog: v0.18.10...v0.18.11
v0.18.10 : update alloy to 0.3.1
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
- Update scala-library, scala-reflect to 2.12.19 by @scala-steward in #1420
- Update alloy to 0.3.1 by @Baccata in #1423
Full Changelog: v0.18.9...v0.18.10
v0.18.9 : support for alloy#nullable
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
- fix infinite recursion when calling Bijection.identity by @benoitlouy in #1401
- Support dynamic status code in error responses by @miguel-vila in #1399
- Update jsoniter-scala-macros to 2.28.1 by @scala-steward in #1394
- Update swagger-ui-dist to 5.11.0 by @scala-steward in #1366
- Add changelog entry and test for bijection fix by @daddykotex in #1403
- Document/Hints/Schema convenience methods by @Baccata in #1404
- Update jsoniter-scala-macros to 2.28.2 by @scala-steward in #1412
- Update upickle to 3.1.5 by @scala-steward in #1413
- Update coursier to 2.1.9 by @scala-steward in #1414
- Update kind-projector to 0.13.3 by @scala-steward in #1417
- Update swagger-ui-dist to 5.11.8 by @scala-steward in #1418
- Add support for @nullable trait in order to support MergePatch usecases by @astridej in #1408
- Update aws smithy version by @miguel-vila in #1419
New Contributors
- @benoitlouy made their first contribution in #1401
- @astridej made their first contribution in #1408
Full Changelog: v0.18.8...v0.18.9
v0.18.8
What's Changed
- Expose RefinementProvider methods by @msosnicki in #1388
Allows constructing refinement schemas manually in more flexible ways than before.
Fixes the collision avoidance algorithm to cover Scala 3 keywords.
Other changes
- Update sbt-bloop to 1.5.14 by @scala-steward in #1387
- Update sbt-bloop to 1.5.15 by @scala-steward in #1393
- Update mill-main, mill-main-api, ... to 0.11.7 by @scala-steward in #1395
New Contributors
Full Changelog: v0.18.7...v0.18.8
v0.18.7
What's changed
- Support
@httpResponseCode
over newtypes by @miguel-vila in #1377
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
- Update nscplugin, sbt-scala-native, ... to 0.4.17 by @scala-steward in #1372
- Update jsoniter-scala-core, ... to 2.27.4 by @scala-steward in #1374
- Update fs2-core, fs2-io to 3.9.4 by @scala-steward in #1373
- Update jsoniter-scala-macros to 2.27.6 by @scala-steward in #1380
- Update weaver-cats, weaver-scalacheck to 0.8.4 by @scala-steward in #1378
- Update jsoniter-scala-core to 2.27.6 by @scala-steward in #1379
- Update jsoniter-scala-core, ... to 2.27.7 by @scala-steward in #1383
Full Changelog: v0.18.6...v0.18.7
v0.18.6
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
- Fix typo in creating-your-own-traits by @valencik in #1350
- Update sbt-projectmatrix to 0.9.2 by @scala-steward in #1352
- Update os-lib to 0.9.3 by @scala-steward in #1355
- Update upickle to 3.1.4 by @scala-steward in #1356
- Update http4s-circe, http4s-client, ... to 0.23.25 by @scala-steward in #1358
- Update slf4j-simple to 2.0.11 by @scala-steward in #1363
- Update jsoniter-scala-core to 2.27.3 by @scala-steward in #1360
- Update sbt-scalajs, scalajs-compiler, ... to 1.15.0 by @scala-steward in #1359
- Update jsoniter-scala-macros to 2.27.3 by @scala-steward in #1361
- Update fs2-data-xml to 1.10.0 by @scala-steward in #1357
- Update sbt-jmh to 0.4.7 by @scala-steward in #1367
New Contributors
Full Changelog: v0.18.5...v0.18.6
v0.18.5 : x-www-form-urlencoded bug fix
This releases fixes a bug related to default values in the x-www-form-urlencoded encoding.
See #1323
What's Changed
- Updated headers for 2024 by @Baccata in #1337
- Bump actions/download-artifact from 3 to 4 by @dependabot in #1336
- Use field.getUnlessDefault instead of field.get in UrlFormDataEncoder by @bpholt in #1323
Full Changelog: v0.18.4...v0.18.5
v0.18.4
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.
- fix: Do not evaluate traits of traits members recursively by @ghostbuster91 in #1305
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
- Update os-lib to 0.9.2 by @scala-steward in #1288
- Update fs2-core, fs2-io to 3.9.3 by @scala-steward in #1291
- Update PULL_REQUEST_TEMPLATE.md for checkboxes by @daddykotex in #1294
- Update smithy-build, smithy-model to 1.41.0 by @scala-steward in #1292
- Update http4s-circe, http4s-client, ... to 0.23.24 by @scala-steward in #1298
- Update smithy-build, smithy-model to 1.41.1 by @scala-steward in #1303
- Update sbt-sonatype to 3.10.0 by @scala-steward in #1302
- Update sbt-bloop to 1.5.12 by @scala-steward in #1309
- Update coursier to 2.1.8 by @scala-steward in #1311
- Update mill-main, mill-main-api, ... to 0.11.6 by @scala-steward in #1310
- Update swagger-ui-dist to 5.9.4 by @scala-steward in #1314
- Update webjars-locator to 0.50 by @scala-steward in #1313
- Update sbt-bloop to 1.5.13 by @scala-steward in #1322
- Update jsoniter-scala-core, ... to 2.25.0 by @scala-steward in #1318
New Contributors
Full Changelog: v0.18.3...v0.18.4
v0.18.3
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
- Add Tests to Confirm Empty Body Fixes by @lewisjkl in #1257
- Update fs2-data-xml to 1.9.1 by @scala-steward in #1261
- Update nscplugin, sbt-scala-native, ... to 0.4.16 by @scala-steward in #1262
- Cleanup some codegen code by @kubukoz in #1259
- Fix AwsInstanceMetadata decoding by @msosnicki in #1266
- Move change to the right place in the changelog by @kubukoz in #1269
- Update jsoniter-scala-macros to 2.24.2 by @scala-steward in #1271
- Render more explicit type annotations by @kubukoz in #1272
- Update jsoniter-scala-macros to 2.24.3 by @scala-steward in #1278
- Update jsoniter-scala-macros to 2.24.4 by @scala-steward in #1281
- Update webjars-locator to 0.48 by @scala-steward in #1276
- Update smithy-build, smithy-model to 1.40.0 by @scala-steward in #1268
- Documentation website updates by @daddykotex in #1286
- Misc fixes: OptionDefaultVisitor and InputOutput on OperationSchema by @daddykotex in #1284
- Throwable toString override by @daddykotex in #1263
- Update swagger-ui-dist to 5.9.1 by @scala-steward in #1277
- Update jsoniter-scala-core to 2.24.4 by @scala-steward in #1280
- Support range/length refinement providers for enums by @Baccata in #1283
Full Changelog: v0.18.2...v0.18.3
v0.18.2 - UrlForm encapsulation improvements
What's Changed
- Expose UrlForm.parse and UrlFormDecodeError by @BalmungSan in #1254
New Contributors
- @BalmungSan made their first contribution in #1254
Full Changelog: v0.18.1...v0.18.2