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 unions #146

Merged
merged 10 commits into from
Aug 26, 2020
Merged

Update unions #146

merged 10 commits into from
Aug 26, 2020

Conversation

JordonPhillips
Copy link
Member

@JordonPhillips JordonPhillips commented Aug 20, 2020

This updates generated unions. Now there will only be a single parent interface, and each member will only be a struct that implements that interface.

This also adds generation of unions to the protocol test generator.

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

Comment on lines +68 to +74
if (target instanceof SimpleShape) {
writer.write("Value $T", memberSymbol);
} else {
writer.write("Value $P", memberSymbol);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Not specific to this PR, but at some point we should take a look at how slice/map types are generated from $T, and $P. If a member is or is not a pointer of a slice/map should not be driven by $T, or $P, the member being a pointer is driven by the modeled list/map shape, and its member.

This mean that $T should generate the correct Go type for a map of strings, i.e. map[string]*string. In addition the same for lists (assuming lists cannot be sparse, i.e. []string. Using $P should generate the pointer type of the outer shape, *map[string]*string and *[]string. $P should have no impact on the generate of nested members within collections.

Copy link
Contributor

Choose a reason for hiding this comment

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

created, #149 for this.

@JordonPhillips JordonPhillips requested a review from jasdel August 25, 2020 20:48
@JordonPhillips JordonPhillips merged commit d68a602 into aws:master Aug 26, 2020
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