Extension Field Registry

x-jsonschema-contentSchema - The JSON Schema contentSchema subschema for decoded string content, used when targeting OpenAPI versions that do not directly support it.

JSON Schema 2019-09 introduced the contentSchema annotation to describe the schema for decoded string content.

The x-jsonschema-contentSchema extension mirrors this JSON Schema keyword when targeting OpenAPI versions where the keyword is not directly available, serializing it as x-jsonschema-contentSchema.

Use this extension only with JSON Schema versions before 2019-09; 2019-09 and later define contentSchema directly.

It can appear as a property in the following objects: ["Schema Object"].

Used by: (informational)

Schema

{"$ref"=>"#/$defs/schemaObject"}

Example

openapi: 3.0.4
info:
  title: My API
  version: 1.0.0
paths: {}
components:
  schemas:
    EncodedPayload:
      type: string
      x-jsonschema-contentEncoding: base64
      x-jsonschema-contentMediaType: application/json
      x-jsonschema-contentSchema:
        type: object
        required:
          - id
        properties:
          id:
            type: string