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
+122Lines changed: 122 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2405,6 +2405,15 @@ While composition offers model extensibility, it does not imply a hierarchy betw
2405
2405
To support polymorphism, the OpenAPI Specification adds the `discriminator` keyword.
2406
2406
When used, the `discriminator` indicates the name of the property that hints which schema definition is expected to validate the structure of the model.
2407
2407
2408
+
###### Generic (Template) Data Structures
2409
+
2410
+
Implementations MAY support defining generic or template data structures using JSON Schema's dynamic referencing feature:
2411
+
2412
+
* `$dynamicAnchor` identifies a set of possible schemas (including a default placeholder schema) to which a `$dynamicRef` can resolve
2413
+
* `$dynamicRef` resolves to the first matching `$dynamicAnchor` encountered on its path from the schema entry point to the reference, as described in the JSON Schema specification
2414
+
2415
+
An example is included in the "Schema Object Examples" section below, and further information can be found on the Learn OpenAPI site's ["Dynamic References"](https://learn.openapis.org/referencing/dynamic.html) page.
2416
+
2408
2417
###### XML Modeling
2409
2418
2410
2419
The [xml](#schemaXml) property allows extra definitions when translating the JSON definition to XML.
When request bodies or response payloads may be one of a number of different schemas, a `discriminator` object gives a hint about the expected schema of the document. It can be used to aid in serialization, deserialization, and validation.
0 commit comments