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

Add @nullable trait and update proposal #1215

Merged
merged 5 commits into from
May 11, 2022
Merged

Conversation

mtdowling
Copy link
Member

  • 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.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mtdowling mtdowling requested a review from a team as a code owner May 5, 2022 03:58
* 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.
@mtdowling mtdowling force-pushed the add-nullable-trait branch from 547135b to 2d4f462 Compare May 5, 2022 21:20
@mtdowling mtdowling requested a review from JordonPhillips May 5, 2022 21:20
@mtdowling mtdowling requested a review from kstich May 6, 2022 23:42
// Get members that changed.
differences.changedShapes(MemberShape.class),
// Get members of structures that added/removed the input trait.
changedInputMembers(differences)
Copy link
Contributor

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?

Copy link
Member Author

@mtdowling mtdowling May 11, 2022

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.

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