Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Dec 15, 2022

Updates the requirements on aws-types to permit the latest version.

Changelog

Sourced from aws-types's changelog.

December 12th, 2022

Breaking Changes:

  • ⚠🎉 (all, smithy-rs#1938, @​jjantdev) Upgrade Rust MSRV to 1.62.1

  • ⚠🎉 (server, smithy-rs#1199, smithy-rs#1342, smithy-rs#1401, smithy-rs#1998, smithy-rs#2005, smithy-rs#2028, smithy-rs#2034, smithy-rs#2036) Constraint traits in server SDKs are beginning to be supported. The following are now supported:

    • The length trait on string shapes.
    • The length trait on map shapes.
    • The length trait on list shapes.
    • The range trait on byte shapes.
    • The range trait on short shapes.
    • The range trait on integer shapes.
    • The range trait on long shapes.
    • The pattern trait on string shapes.

    Upon receiving a request that violates the modeled constraints, the server SDK will reject it with a message indicating why.

    Unsupported (constraint trait, target shape) combinations will now fail at code generation time, whereas previously they were just ignored. This is a breaking change to raise awareness in service owners of their server SDKs behaving differently than what was modeled. To continue generating a server SDK with unsupported constraint traits, set codegenConfig.ignoreUnsupportedConstraints to true in your smithy-build.json.

  • ⚠🎉 (server, smithy-rs#1342, smithy-rs#1119) Server SDKs now generate "constrained types" for constrained shapes. Constrained types are newtypes that encapsulate the modeled constraints. They constitute a widespread pattern to guarantee domain invariants and promote correctness in your business logic. So, for example, the model:

    @length(min: 1, max: 69)
    string NiceString

    will now render a struct NiceString(String). Instantiating a NiceString is a fallible operation:

    let data: String = ... ;
    let nice_string = NiceString::try_from(data).expect("data is not nice");

    A failed attempt to instantiate a constrained type will yield a ConstraintViolation error type you may want to handle. This type's API is subject to change.

    Constrained types guarantee, by virtue of the type system, that your service's operation outputs adhere to the modeled constraints. To learn more about the motivation for constrained types and how they work, see the RFC.

    If you'd like to opt-out of generating constrained types, you can set codegenConfig.publicConstrainedTypes to false. Note that if you do, the generated server SDK will still honor your operation input's modeled constraints upon receiving a request, but will not help you in writing business logic code that adheres to the constraints, and will not prevent you from returning responses containing operation outputs that violate said constraints.

  • 🐛⚠🎉 (server, smithy-rs#1714, smithy-rs#1342) Structure builders in server SDKs have undergone significant changes.

    The API surface has been reduced. It is now simpler and closely follows what you would get when using the derive_builder crate:

    1. Builders no longer have set_* methods taking in Option<T>. You must use the unprefixed method, named exactly after the structure's field name, and taking in a value whose type matches exactly that of the structure's field.
    2. Builders no longer have convenience methods to pass in an element for a field whose type is a vector or a map. You must pass in the entire contents of the collection up front.
    3. Builders no longer implement PartialEq.

    Bug fixes:

    1. Builders now always fail to build if a value for a required member is not provided. Previously, builders were falling back to a default value (e.g. "" for Strings) for some shapes. This was a bug.

... (truncated)

Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Updates the requirements on [aws-types](https://github.com/awslabs/smithy-rs) to permit the latest version.
- [Release notes](https://github.com/awslabs/smithy-rs/releases)
- [Changelog](https://github.com/awslabs/smithy-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/awslabs/smithy-rs/commits)

---
updated-dependencies:
- dependency-name: aws-types
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
@tustvold
Copy link
Contributor

Closing in favor of #3349

@tustvold tustvold closed this Dec 15, 2022
@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Dec 15, 2022

OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant