Home SchemaRegistry Class
SchemaRegistry Class
Cancel

SchemaRegistry Class

Namespace: Json.Schema

Inheritance: SchemaRegistry 🡒 object

Provides a registry for storing and retrieving JSON schemas and other base documents by URI and anchor.

Remarks

The registry supports registering schemas with unique URIs and enables lookup by URI or anchor. Schemas can be fetched automatically using the Json.Schema.SchemaRegistry.Fetch delegate if not already registered. The Json.Schema.SchemaRegistry.Global property provides a shared, application-wide registry instance. Getting schemas via

Properties

NameTypeSummary
FetchFunc<Uri, SchemaRegistry, IBaseDocument>Gets or sets a method to enable automatic download of schemas by $id URI.
GlobalSchemaRegistryThe global registry.

Methods

Get(Uri uri)

Gets a schema by URI ID and/or anchor.

Declaration

1
public IBaseDocument Get(Uri uri)
ParameterTypeDescription
uriUriThe URI ID.

Returns

The schema, if registered in either this or the global registry; otherwise null.

Register(IBaseDocument document)

Registers a schema by URI.

Declaration

1
public void Register(IBaseDocument document)
ParameterTypeDescription
documentIBaseDocumentThe schema.

Register(Uri uri, IBaseDocument document)

Registers a schema by URI.

Declaration

1
public void Register(Uri uri, IBaseDocument document)
ParameterTypeDescription
uriUriThe URI ID of the schema..
documentIBaseDocumentThe schema.
Contents