Skip to content

Use array for SetShape #172

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

Merged
merged 4 commits into from
May 11, 2020
Merged

Use array for SetShape #172

merged 4 commits into from
May 11, 2020

Conversation

trivikr
Copy link
Contributor

@trivikr trivikr commented May 1, 2020

Issue #, if available:
We decided to use Array for SetShape in internal discussions for similar reasons to why Objects are used instead of Map:

  • new Set needs to be created by calling new Set(), just like new Map()
  • setObj.has(value) is similar to objMap.get(key)

Smithy specification for Set https://awslabs.github.io/smithy/spec/core.html#set

Not all languages support set data structures with non-scalar values. Such languages SHOULD represent sets as a custom set data structure that can interpret value hash codes and equality. Alternatively, clients MAY store the values of a set data structure in a list and rely on the service to ensure uniqueness.

Description of changes:
Use array for SetShape

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@trivikr
Copy link
Contributor Author

trivikr commented May 4, 2020

CodeGen PR: aws/aws-sdk-js-v3#1144

Copy link
Contributor

@kstich kstich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trivikr
Copy link
Contributor Author

trivikr commented May 8, 2020

Removed instanceof Set check in e9894d6

@trivikr trivikr merged commit 8d9d0ed into smithy-lang:master May 11, 2020
@trivikr trivikr deleted the setshape-array branch May 11, 2020 17:52
srchase pushed a commit to srchase/smithy-typescript that referenced this pull request Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants