Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

JsonSchemaOptions

OfficeIMO.Json

Namespace
OfficeIMO.Json
Assembly
OfficeIMO.Core
Source revision
ba882f6b0d07 with working tree changes
Modifiers
sealed

How 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

Constructors

public JsonSchemaOptions() #

Properties

public JsonSchemaDraft? Draft { get; set; } #

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; } #

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 exactly as written.

public Func<string, JsonData?>? ReferenceResolver { get; set; } #

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. Nothing is ever fetched from the network or the file system without it.

public bool ValidateFormats { get; set; } #

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 lists them.

public int MaxErrors { get; set; } #

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; } #

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; } #

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; } #

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

Exceptions

  • ArgumentOutOfRangeException – The value is not positive.