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

Flatten AWS newtypes #1110

Merged

Conversation

denisrosca
Copy link
Contributor

AWS in their smithy specs have a tendency to create newtypes for the smithy standard shapes. As part of this change, introduce a projection transformer that will run as a preprocessor before code generation and will replace the newtypes (if they match some criteria) with references to the standard smithy shapes.

For a newtype to be considered as being "replaceable" it has to match the following criteria:

  • doesn't have any traits (other than @default)
  • is a simple shape
  • the name matches the smithy shape (one exception is Date, as it will be replaced with Timestamp even though it doesn't actually match).
  • comes from an AWS namespace (i.e. starts with com.amazonaws)

AWS in their smithy specs have a tendency to create newtypes for
the smithy standard shapes. As part of this change, introduce a
projection transformer that will run as a preprocessor before code
generation and will replace the newtypes (if they match some criteria)
with references to the standard smithy shapes.

For a newtype to be considered as being "replaceable" it has to match
the following criteria:
- doesn't have any traits (other than @default)
- is a simple shape
- the name matches the smithy shape (one exception is Date, as it
will be replaced with Timestamp even though it doesn't actually match).
- comes from an AWS namespace (i.e. starts with com.amazonaws)
@CLAassistant
Copy link

CLAassistant commented Jul 20, 2023

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@Baccata
Copy link
Contributor

Baccata commented Jul 21, 2023

Pretty good work overall :)

@denisrosca
Copy link
Contributor Author

Need some help figuring out the reason for the build failure. Unfortunately, I can't see the error message 🤔

@Baccata
Copy link
Contributor

Baccata commented Jul 21, 2023

@denisrosca, just sync your branch with the latest series/0.17 and it should fix it

@kubukoz
Copy link
Member

kubukoz commented Jul 21, 2023

@Baccata we cool here?

@Baccata Baccata merged commit f042dd4 into disneystreaming:remove-reserved-types Jul 24, 2023
13 checks passed
@Baccata
Copy link
Contributor

Baccata commented Jul 24, 2023

Thanks a lot for this !

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.

None yet

4 participants