We previously rewrote models that target smithy.api#Primtive*
shapes to target their prelude counterparts that do not have the
Primitive prefix. For example, smithy.api#PrimitiveInteger would
become smithy.api#Integer. The rationale being that because optionality
is now controlled on members rather than based on the shape targeted by
a member, there is no longer a reason to use Primitive* shapes in 2.0
models.
The problem is that rewriting the shape targets during the loading
process can remove information that tooling might need to determine if
a shape was considered optional in IDL 1.0 (usually in fringe cases).
If a member previously targets PrimitiveInteger and is rewritten to
target Integer, but the member is also marked as required, then the
ModelUpgrader can't add the default trait to the member. If optionality
isn't determined based on the required trait, then a tool has no way
to know that a member that targets Integer previously targeted
PrimitiveInteger, thereby losing information.
Instead of removing Primitive* shapes, we will keep them in 2.0 and
mark them as deprecated. To point this out to end users, I added
validation (that really should have already existed) to detect when
a shape refers to a deprecated shape. However, because we don't want
to break previous test cases and because models should be able to
deprecate shapes without breaking test cases, DeprecatedShape does not
need to be explicitly handled by Smithy errorfile test runners. This
matches the special casing added for DeprecatedTrait and
ModelDeprecation.