You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: versions/3.1.1.md
+2-5Lines changed: 2 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -2788,15 +2788,12 @@ The OpenAPI Specification allows combining and extending model definitions using
2788
2788
`allOf`takes an array of object definitions that are validated *independently* but together compose a single object.
2789
2789
2790
2790
While composition offers model extensibility, it does not imply a hierarchy between the models.
2791
-
To support polymorphism, the OpenAPI Specification adds the `discriminator` field.
2791
+
To support polymorphism, the OpenAPI Specification adds the [`discriminator`](#schemaDiscriminator) field.
2792
2792
When used, the `discriminator` indicates the name of the property that hints which schema definition is expected to validate the structure of the model.
2793
-
<!-- 3.0.4 contains the following text: does it also apply to 3.1.1?
2794
2793
As such, the `discriminator` field MUST be a required field.
2795
2794
There are two ways to define the value of a discriminator for an inheriting instance.
2796
2795
- Use the schema name.
2797
-
- Override the schema name by overriding the property with a new value. If a new value exists, this takes precedence over the schema name.
2798
-
As such, inline schema definitions, which do not have a given id, *cannot* be used in polymorphism.
2799
-
-->
2796
+
- [Override the schema name](#discriminatorMapping) by overriding the property with a new value. If a new value exists, this takes precedence over the schema name.
0 commit comments