Breaking Change to limit sets to string, blob, byte, short, integer, long, bigInteger, bigDecimal #1106
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sets can now only contain string, blob, byte, short, integer, long, bigInteger,
and bigDecimal shapes. Sets with other types of values are either difficult
to implement in various programming languages (for example, sets of floats in
Rust), or highly problematic for client/server use cases. Clients that are out
of sync with a service model could receive structures or unions from a
service, not recognize new members and drop them, causing the hash codes of
members of the set to collide, and this would result in the client discarding
set entries. For example, a service might return a set of 3 structures, but
when clients deserialize them, they drop unknown members, and the set
contains fewer than 3 entries.
Existing models that already use a set of other types will need to migrate to
use a list rather than a set, and they will need to implement any necessary
uniqueness checks server-side as needed.
While this is a breaking change, allowing sets to contain other types of values has proven to be an unsafe misfeature and something most clients have been unable to support (in fact, most Smithy implementations actually treat sets as lists in generated code).
Closes #1106
Closes #1093
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.