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

Fix filterSuppressions handling of members #989

Merged
merged 1 commit into from
Nov 19, 2021

Conversation

gosar
Copy link
Contributor

@gosar gosar commented Nov 19, 2021

Issue:

FilterSuppressions uses builder.addShape here ) to update the traits on all shapes, including member shapes. However, builder.addShape does not support updating member shapes
directly.

Description of changes:
Instead use ReplaceShapes which handles replacing member shapes too.

Testing:
Updated the traits.smithy test cases to cover the member case. They failed before this change.

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

@gosar gosar requested a review from mtdowling November 19, 2021 06:44
@gosar gosar requested a review from a team as a code owner November 19, 2021 06:44
}

private void filterMetadata(
private Model filterMetadata(
Copy link
Member

Choose a reason for hiding this comment

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

minor: Can you add a check to make sure the model has suppressions defined before recreating it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion. Added a check to make sure suppressions changed before recreating. Also added couple tests cases for 1. no suppressions 2. no change to suppressions.

`builder.addShape` does not allow adding member shapes
directly. Instead use ReplaceShapes which handles replacing member
shapes too.
@gosar gosar merged commit 1dc08e0 into smithy-lang:main Nov 19, 2021
@gosar gosar deleted the filterSuppression-member branch November 19, 2021 19:20
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