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.0.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -2511,15 +2511,15 @@ This object can be extended with [Specification Extensions](#specificationExtens
2511
2511
###### <a name="schemaComposition"></a>Composition and Inheritance (Polymorphism)
2512
2512
2513
2513
The OpenAPI Specification allows combining and extending model definitions using the `allOf` property of JSON Schema, in effect offering model composition.
2514
-
`allOf`takes in an array of object definitions that are validated *independently* but together compose a single object.
2514
+
`allOf`takes an array of object definitions that are validated *independently* but together compose a single object.
2515
2515
2516
2516
While composition offers model extensibility, it does not imply a hierarchy between the models.
2517
-
To support polymorphism, OpenAPI Specification adds the support of the `discriminator` field.
2518
-
When used, the `discriminator` will be the name of the property used to decide which schema definition is used to validate the structure of the model.
2517
+
To support polymorphism, the OpenAPI Specification adds the `discriminator` field.
2518
+
When used, the `discriminator` will be the name of the property that decides which schema definition validates the structure of the model.
2519
2519
As such, the `discriminator` field MUST be a required field.
2520
2520
There are are two ways to define the value of a discriminator for an inheriting instance.
2521
-
- Use the schema's name.
2522
-
- Override the schema's name by overriding the property with a new value. If exists, this takes precedence over the schema's name.
2521
+
- Use the schema name.
2522
+
- Override the schema name by overriding the property with a new value. If a new value exists, this takes precedence over the schema name.
2523
2523
As such, inline schema definitions, which do not have a given id, *cannot* be used in polymorphism.
0 commit comments