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.2.0.md
+122Lines changed: 122 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2420,6 +2420,15 @@ There are two ways to define the value of a discriminator for an inheriting inst
2420
2420
- Override the schema name by overriding the property with a new value. If a new value exists, this takes precedence over the schema name.
2421
2421
As such, inline schema definitions, which do not have a given id, *cannot* be used in polymorphism.
2422
2422
2423
+
###### Generic (Template) Data Structures
2424
+
2425
+
Implementations MAY support defining generic or template data structures using JSON Schema's dynamic referencing feature:
2426
+
2427
+
* `$dynamicAnchor` identifies a set of possible schemas (including a default placeholder schema) to which a `$dynamicRef` can resolve
2428
+
* `$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
2429
+
2430
+
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.
2431
+
2423
2432
###### XML Modeling
2424
2433
2425
2434
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 can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the document of an alternative schema based on the value associated with it.
0 commit comments