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

Collapse member schemas #252

Merged
merged 4 commits into from
May 27, 2024
Merged

Collapse member schemas #252

merged 4 commits into from
May 27, 2024

Conversation

JordonPhillips
Copy link
Contributor

This updates schemas in two ways. First, it renames type to shape_type to avoid shadowing the built in, which may be needed for type signatures later. Second, it changes the way members are created. Members now look mostly like their targets, except with different ids and traits. This makes serialization way easier and less prone to errors since implementations no longer have to follow member references to get traits or worry about how to handle overrides.

Since the MEMBER shape type isn't being used, I removed it.

I also moved a test file that was in the wrong package for some reason.

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

This renames Schema.type to avoid shadowing the built-in `type`
This changes member schemas to look like their targets, except with
the trait lists merged. This is being done to make serialization and
deserialization code much simpler. Having to follow member references
is a pretty big footgun in Smithy itself, and while it nevertheless
makes sense in Smithy, these schemas don't have the same uses case.
@JordonPhillips JordonPhillips requested a review from a team as a code owner May 24, 2024 15:09
nateprewitt
nateprewitt previously approved these changes May 24, 2024
@JordonPhillips JordonPhillips merged commit 6a468ee into develop May 27, 2024
5 checks passed
@JordonPhillips JordonPhillips deleted the collapse-member-schemas branch May 27, 2024 12:19
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.

3 participants