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