Extension Field Registry
x-jsonschema-$anchor - The JSON Schema $anchor identifier for a schema resource, used when targeting OpenAPI versions that do not directly support it.
The x-jsonschema-$anchor extension mirrors the JSON Schema $anchor keyword by serializing it as x-jsonschema-$anchor when targeting OpenAPI versions where $anchor is not directly available.
Use this extension only with JSON Schema versions before 2019-09; 2019-09 and later define $anchor directly.
Like the x-jsonschema- namespace, this extension is intended for OpenAPI 3.0 and earlier. When using OpenAPI 3.1 or later, the OpenAPI jsonSchemaDialect field, or JSON Schema’s "$schema" keyword, should be used instead.
It can appear as a property in the following objects: ["Schema Object"].
Used by: (informational)
- Microsoft.OpenApi (.NET OpenAPI library)
Schema
{"type"=>"string"}
Example
openapi: 3.0.4
info:
title: My API
version: 1.0.0
paths: {}
components:
schemas:
User:
type: object
x-jsonschema-$anchor: User
properties:
id:
type: string