Fix resource identifier collision and validation #1453
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.
When loading a model with multiple members bound to the same resource identifier, Smithy failed with an error in IdentifierBindingIndex due to Collectors.toMap:
This change updates IdentifierBindingIndex to ignore collisions. However this means that colliding resource identifier bindings would be ignored (which is arguably worse than failing to load the model since it wouldn't ever flag these issues, and retroactively enforcing things is always challenging). To address this, I added validation to detect when members with the resourceIdentifier trait conflict with members of the same binding name or members that have the same resourceIdentifier trait.
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.