From 546913677946b805be9d6badbe068438bfa359a9 Mon Sep 17 00:00:00 2001 From: Michael Dowling Date: Tue, 1 Aug 2023 10:55:39 -0500 Subject: [PATCH] Better document trait merging Closes #1744 --- docs/source-2.0/spec/model.rst | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/source-2.0/spec/model.rst b/docs/source-2.0/spec/model.rst index 4469c6f20a1..3430edb0b96 100644 --- a/docs/source-2.0/spec/model.rst +++ b/docs/source-2.0/spec/model.rst @@ -285,11 +285,11 @@ Multiple :ref:`model files ` can be used to create a :ref:`semantic model `. Implementations MUST take the following steps when merging two or more model files: -#. Merge the metadata objects of all model files. If top-level metadata +1. Merge the metadata objects of all model files. If top-level metadata key-value pairs conflict, :ref:`merge the metadata ` if possible or fail. -#. Shapes defined in a single model file are added to the semantic model as-is. -#. Shapes with the same shape ID defined in multiple model files are +2. Shapes defined in a single model file are added to the semantic model as-is. +3. Shapes with the same shape ID defined in multiple model files are reconciled using the following rules: #. All conflicting shapes MUST have the same shape type. @@ -297,9 +297,12 @@ take the following steps when merging two or more model files: the same members that target the same shapes. #. Conflicting :ref:`service shape types ` MUST contain the same properties and target the same shapes. -#. Conflicting traits defined in shape definitions or through - :ref:`apply statements ` are reconciled using - :ref:`trait conflict resolution `. + #. The traits from each shape are treated as if they are defined using + an :ref:`apply statement `: non-conflicting traits are + added to the merged shape, and conflicting traits are resolved through + step (4). +4. Conflicting traits defined in shape definitions or through apply statements + are reconciled using :ref:`trait conflict resolution `. .. _shapes: