[0.10] Apply streaming trait directly to shapes #340
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This updates the streaming trait to apply directly to shapes instead of
members. This was previously restricted to members because it made the
model easier to validate and grok at a glance. However, keeping it on
members introduces potential errors in code generation. A given blob
could have both the streaming trait and the media type trait, for
instance. Both of these traits could result in a new type being created,
but since the streaming trait is applied to a member that type is
implicit. The code generator would have to try to generate a name that
doesn't conflict with any existing names, which is very error prone and
likely would result in unfortunate names. Moving this trait to the
shape directly makes the naming concern an explicit part of modeling,
where it will only have to be handled once.
This also brings the trait in line with the general best practice of
having traits that impact the type generated apply directly to the
shapes they impact.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.