-
Notifications
You must be signed in to change notification settings - Fork 228
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
Add @nullable
trait and update proposal
#1215
Conversation
* Move `aws.api#clientOptional` to `smithy.api#nullable`. In order for diff tools to understand backward compatible changes, this trait has to be a core part of Smithy that tooling can reason about. The trait has utility outside of AWS too as it allows any model to define their own backward compatibility guarantees for a required member and does not require teams to ignore Smithy's built-in diff support that checks for allowed `@required` changes. * Remove Smithy 2.0 traits and semantics from 1.0. Adding `@default` and allowing `@nullable` in 1.0 made an already complex nullability story impossibly complex. `@default` and `@nullable` is now only be allowed in Smithy 2.0.
547135b
to
2d4f462
Compare
// Get members that changed. | ||
differences.changedShapes(MemberShape.class), | ||
// Get members of structures that added/removed the input trait. | ||
changedInputMembers(differences) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do members not count as having changed if their traits change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, any change to a member gets picked up. The difference here is that the structure that contains the member changed, so that has to be detected separately.
aws.api#clientOptional
tosmithy.api#nullable
. In orderfor diff tools to understand backward compatible changes, this trait has to
be a core part of Smithy that tooling can reason about. The trait has
utility outside of AWS too as it allows any model to define their own
backward compatibility guarantees for a required member and does not
require teams to ignore Smithy's built-in diff support that checks for
allowed
@required
changes.@default
andallowing
@nullable
in 1.0 made an already complex nullability storyimpossibly complex.
@default
and@nullable
is now only be allowed inSmithy 2.0.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.