Skip to content

Commit 6783913

Browse files
committed
Alternatives for update of discriminator value
1 parent cfc2fda commit 6783913

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

azure/Guidelines.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,9 +551,16 @@ The [Azure Naming Guidelines](./ConsiderationsForServiceDesign.md#common-names)
551551
<a name="json-polymorphism-kind-extensible"></a>
552552
:ballot_box_with_check: **YOU SHOULD** define the discriminator field of a polymorphic type to be an extensible enum.
553553

554+
**WE SHOULD CHOOSE ONE OF THE FOLLOWING TWO OPTIONS**
555+
554556
<a name="json-polymorphism-kind-immutable"></a>
555557
:warning: **YOU SHOULD NOT** allow an update (patch) to change the discriminator field of a polymorphic type.
556558

559+
**OR**
560+
561+
<a name="json-polymorphism-mutable-kind"></a>
562+
:ballot_box_with_check: **YOU SHOULD** remove all properties specific to the old discriminator value from the resource when an update (patch) changes the discriminator field.
563+
557564
<a name="json-polymorphism-versioning"></a>
558565
:warning: **YOU SHOULD NOT** return properties of a polymorphic type that are not defined for the api-version specified in the request.
559566

0 commit comments

Comments
 (0)