Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class Newtonsoft.​Json.​Schema.​JsonSchema

Assembly: Newtonsoft.Json

Inheritance: object → JsonSchema

<para> An in-memory representation of a JSON Schema. </para> <note type="caution"> JSON Schema validation has been moved to its own package. See <see href="http://www.newtonsoft.com/jsonschema">http://www.newtonsoft.com/jsonschema</see> for more details. </note>

Properties

public string
Id
Gets or sets the id.
public string
Title
Gets or sets the title.
public bool?
Required
Gets or sets whether the object is required.
public bool?
ReadOnly
Gets or sets whether the object is read-only.
public bool?
Hidden
Gets or sets whether the object is visible to users.
public bool?
Transient
Gets or sets whether the object is transient.
public string
Description
Gets or sets the description of the object.
public JsonSchemaType?
Type
Gets or sets the types of values allowed by the object.
public string
Pattern
Gets or sets the pattern.
public int?
MinimumLength
Gets or sets the minimum length.
public int?
MaximumLength
Gets or sets the maximum length.
public double?
DivisibleBy
Gets or sets a number that the value should be divisible by.
public double?
Minimum
Gets or sets the minimum.
public double?
Maximum
Gets or sets the maximum.
public bool?
ExclusiveMinimum
Gets or sets a flag indicating whether the value can not equal the number defined by the <c>minimum</c> attribute ( <see cref="P:Newtonsoft.Json.Schema.JsonSchema.Minimum" /> ).
public bool?
ExclusiveMaximum
Gets or sets a flag indicating whether the value can not equal the number defined by the <c>maximum</c> attribute ( <see cref="P:Newtonsoft.Json.Schema.JsonSchema.Maximum" /> ).
public int?
MinimumItems
Gets or sets the minimum number of items.
public int?
MaximumItems
Gets or sets the maximum number of items.
Gets or sets the <see cref="T:Newtonsoft.Json.Schema.JsonSchema" /> of items.
public bool
PositionalItemsValidation
Gets or sets a value indicating whether items in an array are validated using the <see cref="T:Newtonsoft.Json.Schema.JsonSchema" /> instance at their array position from <see cref="P:Newtonsoft.Json.Schema.JsonSchema.Items" /> .
public JsonSchema
AdditionalItems
Gets or sets the <see cref="T:Newtonsoft.Json.Schema.JsonSchema" /> of additional items.
public bool
AllowAdditionalItems
Gets or sets a value indicating whether additional items are allowed.
public bool
UniqueItems
Gets or sets whether the array items must be unique.
Gets or sets the <see cref="T:Newtonsoft.Json.Schema.JsonSchema" /> of properties.
public JsonSchema
AdditionalProperties
Gets or sets the <see cref="T:Newtonsoft.Json.Schema.JsonSchema" /> of additional properties.
PatternProperties
Gets or sets the pattern properties.
public bool
AllowAdditionalProperties
Gets or sets a value indicating whether additional properties are allowed.
public string
Requires
Gets or sets the required property if this property is present.
Gets or sets the a collection of valid enum values allowed.
public JsonSchemaType?
Disallow
Gets or sets disallowed types.
Default
Gets or sets the default value.
Gets or sets the collection of <see cref="T:Newtonsoft.Json.Schema.JsonSchema" /> that this schema extends.
public string
Format
Gets or sets the format.

Methods

public static JsonSchema
Read​(JsonReader reader)
Reads a <see cref="T:Newtonsoft.Json.Schema.JsonSchema" /> from the specified <see cref="T:Newtonsoft.Json.JsonReader" /> .
Returns The <see cref="T:Newtonsoft.Json.Schema.JsonSchema" /> object representing the JSON Schema.
reader The <see cref="T:Newtonsoft.Json.JsonReader" /> containing the JSON Schema to read.
public static JsonSchema
Read​(JsonReader reader, JsonSchemaResolver resolver)
Reads a <see cref="T:Newtonsoft.Json.Schema.JsonSchema" /> from the specified <see cref="T:Newtonsoft.Json.JsonReader" /> .
Returns The <see cref="T:Newtonsoft.Json.Schema.JsonSchema" /> object representing the JSON Schema.
reader The <see cref="T:Newtonsoft.Json.JsonReader" /> containing the JSON Schema to read.
resolver The <see cref="T:Newtonsoft.Json.Schema.JsonSchemaResolver" /> to use when resolving schema references.
public static JsonSchema
Parse​(string json)
Load a <see cref="T:Newtonsoft.Json.Schema.JsonSchema" /> from a string that contains JSON Schema.
Returns A <see cref="T:Newtonsoft.Json.Schema.JsonSchema" /> populated from the string that contains JSON Schema.
json A <see cref="T:System.String" /> that contains JSON Schema.
public static JsonSchema
Parse​(string json, JsonSchemaResolver resolver)
Load a <see cref="T:Newtonsoft.Json.Schema.JsonSchema" /> from a string that contains JSON Schema using the specified <see cref="T:Newtonsoft.Json.Schema.JsonSchemaResolver" /> .
Returns A <see cref="T:Newtonsoft.Json.Schema.JsonSchema" /> populated from the string that contains JSON Schema.
json A <see cref="T:System.String" /> that contains JSON Schema.
resolver The resolver.
public void
WriteTo​(JsonWriter writer)
Writes this schema to a <see cref="T:Newtonsoft.Json.JsonWriter" /> .
writer A <see cref="T:Newtonsoft.Json.JsonWriter" /> into which this method will write.
public void
WriteTo​(JsonWriter writer, JsonSchemaResolver resolver)
Writes this schema to a <see cref="T:Newtonsoft.Json.JsonWriter" /> using the specified <see cref="T:Newtonsoft.Json.Schema.JsonSchemaResolver" /> .
writer A <see cref="T:Newtonsoft.Json.JsonWriter" /> into which this method will write.
resolver The resolver used.
public string
ToString​()
Returns a <see cref="T:System.String" /> that represents the current <see cref="T:System.Object" /> .
Returns A <see cref="T:System.String" /> that represents the current <see cref="T:System.Object" /> .
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object