# JsonSchemaOptions

How JsonSchema reads a schema and how far validation may go.

Class 

`OfficeIMO.Json`

**Namespace**

`OfficeIMO.Json`

**Assembly**

`OfficeIMO.Core`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[JsonSchemaOptions.cs:19](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Json/JsonSchemaOptions.cs#L19)

**Modifiers**

sealed

How [JsonSchema](/api/core/officeimo-json-jsonschema/) reads a schema and how far validation may go.

## Inheritance

- object
- JsonSchemaOptions

## Remarks

The limits bound the work an untrusted schema or document can cause. Every limit reached is reported as a finding, so a result is never silently incomplete.

## Usage

Explore 2 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Accepted by parameters 2

- Method [JsonSchema.Load](/api/core/officeimo-json-jsonschema/#method-load-officeimo-json-jsondata-officeimo-json-jsonschemaoptions) parameter `options`
- Method [JsonSchema.Parse](/api/core/officeimo-json-jsonschema/#method-parse-string-officeimo-json-jsonschemaoptions) parameter `options`

Filter members 

Show inherited

## Constructors

`public JsonSchemaOptions()` [#](#constructor-ctor)

[JsonSchemaOptions.cs:19](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Json/JsonSchemaOptions.cs#L19)

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public JsonSchemaDraft? Draft { get; set; }` [#](#property-draft)

[JsonSchemaOptions.cs:25](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Json/JsonSchemaOptions.cs#L25)

Gets or sets the dialect. When null, the root schema's $schema decides, and draft 2020-12 is used when it is absent or not recognised.

`public string? BaseUri { get; set; }` [#](#property-baseuri)

[JsonSchemaOptions.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Json/JsonSchemaOptions.cs#L32)

Gets or sets the absolute URI the root schema was retrieved from, against which relative $id and $ref values resolve. When null and the root has no absolute $id, relative references reach [JsonSchemaOptions.ReferenceResolver](/api/core/officeimo-json-jsonschemaoptions/) exactly as written.

`public Func<string, JsonData?>? ReferenceResolver { get; set; }` [#](#property-referenceresolver)

[JsonSchemaOptions.cs:39](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Json/JsonSchemaOptions.cs#L39)

Gets or sets the callback that supplies schemas for references outside the loaded document. It receives the resolved URI without its fragment and returns the schema, or null when it cannot. Each URI is requested at most once per [JsonSchema](/api/core/officeimo-json-jsonschema/). Nothing is ever fetched from the network or the file system without it.

`public bool ValidateFormats { get; set; }` [#](#property-validateformats)

[JsonSchemaOptions.cs:46](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Json/JsonSchemaOptions.cs#L46)

Gets or sets whether format asserts the formats the validator knows (dates, times, durations, e-mail addresses, host names, IP addresses, URIs, UUIDs, regular expressions and JSON pointers). The default is true. Formats it does not know are never errors; [JsonSchemaValidationResult.UncheckedFormats](/api/core/officeimo-json-jsonschemavalidationresult/) lists them.

`public int MaxErrors { get; set; }` [#](#property-maxerrors)

[JsonSchemaOptions.cs:51](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Json/JsonSchemaOptions.cs#L51)

Gets or sets the number of findings after which validation stops. The default is 100.

Exceptions

- `ArgumentOutOfRangeException` – The value is less than 1.

`public int MaxDepth { get; set; }` [#](#property-maxdepth)

[JsonSchemaOptions.cs:58](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Json/JsonSchemaOptions.cs#L58)

Gets or sets how deeply schemas may nest during validation, counting subschemas and followed references. The default is 256.

Exceptions

- `ArgumentOutOfRangeException` – The value is less than 1.

`public long MaxEvaluationSteps { get; set; }` [#](#property-maxevaluationsteps)

[JsonSchemaOptions.cs:65](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Json/JsonSchemaOptions.cs#L65)

Gets or sets how many schema evaluations, counting each uniqueItems comparison of items with equal hashes, one validation may perform before it stops. The default is ten million.

Exceptions

- `ArgumentOutOfRangeException` – The value is less than 1.

`public TimeSpan RegexTimeout { get; set; }` [#](#property-regextimeout)

[JsonSchemaOptions.cs:72](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Json/JsonSchemaOptions.cs#L72)

Gets or sets how long one pattern or patternProperties match may run. The default is one second.

Exceptions

- `ArgumentOutOfRangeException` – The value is not positive.

<!-- PowerForge markdown artifact sha256:67C8CD758C685ED24BB3BCBF5D163B726E7D0B6F6CA75A63CBDA029A930F9F11 -->
