Skip to content

Commit

Permalink
Better document trait merging
Browse files Browse the repository at this point in the history
Closes #1744
  • Loading branch information
mtdowling committed Aug 1, 2023
1 parent ef15e6d commit 5469136
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions docs/source-2.0/spec/model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -285,21 +285,24 @@ Multiple :ref:`model files <model-files>` can be used to create a
:ref:`semantic model <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 <merging-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.
#. Conflicting :ref:`aggregate shape types <aggregate-types>` MUST contain
the same members that target the same shapes.
#. Conflicting :ref:`service shape types <service-types>` MUST contain the
same properties and target the same shapes.
#. Conflicting traits defined in shape definitions or through
:ref:`apply statements <apply-statements>` are reconciled using
:ref:`trait conflict resolution <trait-conflict-resolution>`.
#. The traits from each shape are treated as if they are defined using
an :ref:`apply statement <apply-statements>`: 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 <trait-conflict-resolution>`.


.. _shapes:
Expand Down

0 comments on commit 5469136

Please sign in to comment.