Extension Field Registry
x-jsonschema-dependentSchemas - A map of schemas that apply when corresponding properties are present, used when targeting OpenAPI versions that do not directly support dependentSchemas.
JSON Schema 2019-09 introduced the dependentSchemas keyword to map property names to schemas that apply when the corresponding property is present.
The x-jsonschema-dependentSchemas extension mirrors this JSON Schema keyword when targeting OpenAPI versions where the keyword is not directly available, serializing it as x-jsonschema-dependentSchemas.
Use this extension only with JSON Schema versions before 2019-09; 2019-09 and later define dependentSchemas directly.
It can appear as a property in the following objects: ["Schema Object"].
Used by: (informational)
- Microsoft.OpenApi (.NET OpenAPI library)
Schema
{"type"=>"object", "additionalProperties"=>{"$ref"=>"#/$defs/schemaObject"}}
Example
openapi: 3.0.4
info:
title: My API
version: 1.0.0
paths: {}
components:
schemas:
Payment:
type: object
properties:
creditCard:
type: string
billingAddress:
type: string
x-jsonschema-dependentSchemas:
creditCard:
required:
- billingAddress