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

Update uses of SetShape to ListShape #1670

Open
Tracked by #1401
Velfi opened this issue Aug 25, 2022 · 2 comments
Open
Tracked by #1401

Update uses of SetShape to ListShape #1670

Velfi opened this issue Aug 25, 2022 · 2 comments
Assignees
Labels
good first issue Good for newcomers refactoring Changes that do not affect our users, mostly focused on maintainability

Comments

@Velfi
Copy link
Contributor

Velfi commented Aug 25, 2022

Also, remove the old Set-handling logic. Sets no longer exist in Smithy IDL v2.0.

@DavidOgunsAWS
Copy link
Contributor

Smithy 2.0 introduced the uniqueItems constraint trait for lists and is the recommended type + constraint to replace (now removed from IDL) SetShape. This constraint trait is only expected to be handled with server side request validation, but clients should not care.

Further notes:

  • uniqueItems trait requires the List member type have specific value equality semantics which should align fairly well with Rust types and traits.
  • SetShape class still exists for 1.0 model processing compatibility. SetShape is a subclass of ListShape so handling of ListShape with the uniqueItems trait should (in many cases) satisfy Set handling as well in 1.0 models unless the prior implementation of Sets had further semantics that do not apply to List/uniqueItems.

@david-perez david-perez self-assigned this Dec 7, 2022
@david-perez david-perez removed the good first issue Good for newcomers label Jan 4, 2023
@david-perez david-perez added this to the Server GA milestone Jan 4, 2023
@david-perez
Copy link
Contributor

As of #2232, @uniqueItems is honored by server SDKs.

Keeping this open to track modifying all uses of SetShape in smithy-rs to ListShape or CollectionShape; since Smithy parses v1 models by transpiling set shapes into ListShapes, we should not have to use SetShape anywhere. I've modified the title too.

@david-perez david-perez changed the title Update smithy-rs to handle List types with the uniqueItems trait Update uses of SetShape to ListShape Feb 3, 2023
@david-perez david-perez added good first issue Good for newcomers and removed constraint-traits labels Feb 3, 2023
@david-perez david-perez removed this from the Server GA milestone Feb 3, 2023
@jdisanti jdisanti added the refactoring Changes that do not affect our users, mostly focused on maintainability label Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers refactoring Changes that do not affect our users, mostly focused on maintainability
Projects
None yet
Development

No branches or pull requests

5 participants