johnstonskj / rust-atelier

Rust native core model for the AWS Smithy IDL
MIT License
77 stars 11 forks source link

[SPEC] Apply trait duplicate rules on `apply_trait` #5

Closed johnstonskj closed 3 years ago

johnstonskj commented 4 years ago

Is your request related to a problem? Please describe. Currently applying a trait adds it to a vector.

The Smithy spec says... From trait conflict resolution:

Trait conflict resolution is used when the same trait is applied multiple times to a shape. Duplicate traits applied to shapes are allowed in the following cases:

  1. If the trait is a list or set shape, then the conflicting trait values are concatenated into a single trait value.
  2. If both values are exactly equal, then the conflict is ignored.

All other instances of trait collisions are prohibited.

Additional context Add any other context or screenshots about the feature request here.

johnstonskj commented 3 years ago

Completed