Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested server structure member shapes targeting simple shapes with default trait #2352

Merged
merged 10 commits into from
Feb 17, 2023
8 changes: 8 additions & 0 deletions CHANGELOG.next.toml
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,11 @@ message = "Fluent builder methods on the client are now marked as deprecated whe
references = ["aws-sdk-rust#740"]
meta = { "breaking" = false, "tada" = true, "bug" = true, "target" = "client"}
author = "Velfi"

[[smithy-rs]]
message = """
82marbag marked this conversation as resolved.
Show resolved Hide resolved
Fix bug whereby nested server structure member shapes targeting simple shapes with `@default`
produced Rust code that did not compile"""
references = ["smithy-rs#2352", "smithy-rs#2343"]
meta = { "breaking" = false, "tada" = false, "bug" = true, "target" = "server"}
author = "82marbag"
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fun Shape.isDirectlyConstrained(symbolProvider: SymbolProvider): Boolean = when
// The only reason why the functions in this file have
// to take in a `SymbolProvider` is because non-`required` blob streaming members are interpreted as
// `required`, so we can't use `member.isOptional` here.
this.members().map { symbolProvider.toSymbol(it) }.any { !it.isOptional() }
this.members().any { !symbolProvider.toSymbol(it).isOptional() && !it.hasNonNullDefault() }
}

is MapShape -> this.hasTrait<LengthTrait>()
Expand Down