Home JsonSchemaBuilderExtensions Class
JsonSchemaBuilderExtensions Class
Cancel

JsonSchemaBuilderExtensions Class

Namespace: Json.Schema

Inheritance: JsonSchemaBuilderExtensions 🡒 object

Provides a fluent interface for Json.Schema.JsonSchemaBuilder.

Methods

AdditionalItems(this JsonSchemaBuilder builder, JsonSchema schema)

Add an additionalItems keyword.

Declaration

1
public static JsonSchemaBuilder AdditionalItems(this JsonSchemaBuilder builder, JsonSchema schema)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
schemaJsonSchemaThe schema for additionalItems.

Returns

The builder.

AdditionalProperties(this JsonSchemaBuilder builder, JsonSchema schema)

Add an additionalProperties keyword.

Declaration

1
public static JsonSchemaBuilder AdditionalProperties(this JsonSchemaBuilder builder, JsonSchema schema)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
schemaJsonSchemaThe schema for additionalProperties.

Returns

The builder.

AllOf(this JsonSchemaBuilder builder, params JsonSchema[] schemas)

Add an allOf keyword.

Declaration

1
public static JsonSchemaBuilder AllOf(this JsonSchemaBuilder builder, params JsonSchema[] schemas)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
schemasparams JsonSchema[]The schemas for allOf.

Returns

The builder.

AllOf(this JsonSchemaBuilder builder, IEnumerable<JsonSchema> schemas)

Add an allOf keyword.

Declaration

1
public static JsonSchemaBuilder AllOf(this JsonSchemaBuilder builder, IEnumerable<JsonSchema> schemas)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
schemasIEnumerable<JsonSchema>The schemas for allOf.

Returns

The builder.

Anchor(this JsonSchemaBuilder builder, string reference)

Add an $anchor keyword.

Declaration

1
public static JsonSchemaBuilder Anchor(this JsonSchemaBuilder builder, string reference)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
referencestringThe anchor reference.

Returns

The builder.

AnyOf(this JsonSchemaBuilder builder, params JsonSchema[] schemas)

Add an anyOf keyword.

Declaration

1
public static JsonSchemaBuilder AnyOf(this JsonSchemaBuilder builder, params JsonSchema[] schemas)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
schemasparams JsonSchema[]The schemas for anyOf.

Returns

The builder.

AnyOf(this JsonSchemaBuilder builder, IEnumerable<JsonSchema> schemas)

Add an anyOf keyword.

Declaration

1
public static JsonSchemaBuilder AnyOf(this JsonSchemaBuilder builder, IEnumerable<JsonSchema> schemas)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
schemasIEnumerable<JsonSchema>The schemas for anyOf.

Returns

The builder.

Comment(this JsonSchemaBuilder builder, string comment)

Add a $comment keyword.

Declaration

1
public static JsonSchemaBuilder Comment(this JsonSchemaBuilder builder, string comment)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
commentstringThe comment.

Returns

The builder.

Const(this JsonSchemaBuilder builder, JsonNode node)

Add a const keyword.

Declaration

1
public static JsonSchemaBuilder Const(this JsonSchemaBuilder builder, JsonNode node)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
nodeJsonNodeThe constant value.

Returns

The builder.

Contains(this JsonSchemaBuilder builder, JsonSchema schema)

Add an contains keyword.

Declaration

1
public static JsonSchemaBuilder Contains(this JsonSchemaBuilder builder, JsonSchema schema)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
schemaJsonSchemaThe schema for contains.

Returns

The builder.

Default(this JsonSchemaBuilder builder, JsonNode node)

Add a default keyword.

Declaration

1
public static JsonSchemaBuilder Default(this JsonSchemaBuilder builder, JsonNode node)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
nodeJsonNodeThe value.

Returns

The builder.

Definitions(this JsonSchemaBuilder builder, IReadOnlyDictionary<string, JsonSchema> defs)

Add a definitions keyword.

Declaration

1
public static JsonSchemaBuilder Definitions(this JsonSchemaBuilder builder, IReadOnlyDictionary<string, JsonSchema> defs)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
defsIReadOnlyDictionary<string, JsonSchema>The schema definition map.

Returns

The builder.

Definitions(this JsonSchemaBuilder builder, params (string name, JsonSchema schema)[] defs)

Add a definitions keyword.

Declaration

1
public static JsonSchemaBuilder Definitions(this JsonSchemaBuilder builder, params (string name, JsonSchema schema)[] defs)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
defsparams (string name, JsonSchema schema)[]The schema definition map.

Returns

The builder.

Defs(this JsonSchemaBuilder builder, IReadOnlyDictionary<string, JsonSchema> defs)

Add a $defs keyword.

Declaration

1
public static JsonSchemaBuilder Defs(this JsonSchemaBuilder builder, IReadOnlyDictionary<string, JsonSchema> defs)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
defsIReadOnlyDictionary<string, JsonSchema>The schema definition map.

Returns

The builder.

Defs(this JsonSchemaBuilder builder, params (string name, JsonSchema schema)[] defs)

Add a $defs keyword.

Declaration

1
public static JsonSchemaBuilder Defs(this JsonSchemaBuilder builder, params (string name, JsonSchema schema)[] defs)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
defsparams (string name, JsonSchema schema)[]The schema definition map.

Returns

The builder.

Dependencies(this JsonSchemaBuilder builder, IReadOnlyDictionary<string, SchemaOrPropertyList> deps)

Add a dependencies keyword.

Declaration

1
public static JsonSchemaBuilder Dependencies(this JsonSchemaBuilder builder, IReadOnlyDictionary<string, SchemaOrPropertyList> deps)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
depsIReadOnlyDictionary<string, SchemaOrPropertyList>The dependencies.

Returns

The builder.

Dependencies(this JsonSchemaBuilder builder, params (string name, SchemaOrPropertyList dep)[] deps)

Add a dependencies keyword.

Declaration

1
public static JsonSchemaBuilder Dependencies(this JsonSchemaBuilder builder, params (string name, SchemaOrPropertyList dep)[] deps)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
depsparams (string name, SchemaOrPropertyList dep)[]The dependencies.

Returns

The builder.

DependentRequired(this JsonSchemaBuilder builder, IReadOnlyDictionary<string, IReadOnlyList<string>> deps)

Add a dependentRequired keyword.

Declaration

1
public static JsonSchemaBuilder DependentRequired(this JsonSchemaBuilder builder, IReadOnlyDictionary<string, IReadOnlyList<string>> deps)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
depsIReadOnlyDictionary<string, IReadOnlyList<string>>The dependencies.

Returns

The builder.

DependentRequired(this JsonSchemaBuilder builder, params (string name, IEnumerable<string> properties)[] deps)

Add a dependentRequired keyword.

Declaration

1
public static JsonSchemaBuilder DependentRequired(this JsonSchemaBuilder builder, params (string name, IEnumerable<string> properties)[] deps)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
depsparams (string name, IEnumerable<string> properties)[]The dependencies.

Returns

The builder.

DependentSchemas(this JsonSchemaBuilder builder, IReadOnlyDictionary<string, JsonSchema> deps)

Add a dependentSchemas keyword.

Declaration

1
public static JsonSchemaBuilder DependentSchemas(this JsonSchemaBuilder builder, IReadOnlyDictionary<string, JsonSchema> deps)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
depsIReadOnlyDictionary<string, JsonSchema>The dependencies.

Returns

The builder.

DependentSchemas(this JsonSchemaBuilder builder, params (string name, JsonSchema schema)[] deps)

Add a dependentSchemas keyword.

Declaration

1
public static JsonSchemaBuilder DependentSchemas(this JsonSchemaBuilder builder, params (string name, JsonSchema schema)[] deps)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
depsparams (string name, JsonSchema schema)[]The dependencies.

Returns

The builder.

Deprecated(this JsonSchemaBuilder builder, bool deprecated)

Add a deprecated keyword.

Declaration

1
public static JsonSchemaBuilder Deprecated(this JsonSchemaBuilder builder, bool deprecated)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
deprecatedboolWhether the schema is deprecated.

Returns

The builder.

Description(this JsonSchemaBuilder builder, string description)

Add a description keyword.

Declaration

1
public static JsonSchemaBuilder Description(this JsonSchemaBuilder builder, string description)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
descriptionstringThe description.

Returns

The builder.

DynamicAnchor(this JsonSchemaBuilder builder, string reference)

Add an $dynamicAnchor keyword.

Declaration

1
public static JsonSchemaBuilder DynamicAnchor(this JsonSchemaBuilder builder, string reference)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
referencestringThe anchor reference.

Returns

The builder.

DynamicRef(this JsonSchemaBuilder builder, Uri reference)

Add a $dynamicRef keyword.

Declaration

1
public static JsonSchemaBuilder DynamicRef(this JsonSchemaBuilder builder, Uri reference)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
referenceUriThe URI reference.

Returns

The builder.

DynamicRef(this JsonSchemaBuilder builder, string reference)

Add a $dynamicRef keyword.

Declaration

1
public static JsonSchemaBuilder DynamicRef(this JsonSchemaBuilder builder, string reference)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
referencestringThe URI reference.

Returns

The builder.

Else(this JsonSchemaBuilder builder, JsonSchema schema)

Add an else keyword.

Declaration

1
public static JsonSchemaBuilder Else(this JsonSchemaBuilder builder, JsonSchema schema)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
schemaJsonSchemaThe schema for else.

Returns

The builder.

Enum(this JsonSchemaBuilder builder, IEnumerable<JsonNode> elements)

Add an enum keyword.

Declaration

1
public static JsonSchemaBuilder Enum(this JsonSchemaBuilder builder, IEnumerable<JsonNode> elements)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
elementsIEnumerable<JsonNode>The values for the enum.

Returns

The builder.

Enum(this JsonSchemaBuilder builder, params JsonNode[] elements)

Add an enum keyword.

Declaration

1
public static JsonSchemaBuilder Enum(this JsonSchemaBuilder builder, params JsonNode[] elements)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
elementsparams JsonNode[]The values for the enum.

Returns

The builder.

Enum(this JsonSchemaBuilder builder, IEnumerable<string> elements)

Add an enum keyword.

Declaration

1
public static JsonSchemaBuilder Enum(this JsonSchemaBuilder builder, IEnumerable<string> elements)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
elementsIEnumerable<string>The values for the enum.

Returns

The builder.

Remarks

This overload is provided as a convenience as string-only enums are most common.

Evaluate(this JsonSchemaBuilder builder, JsonNode root, EvaluationOptions options)

Convenience method that builds and evaluates with a single call.

Declaration

1
public static EvaluationResults Evaluate(this JsonSchemaBuilder builder, JsonNode root, EvaluationOptions options)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
rootJsonNodeThe root instance.
optionsEvaluationOptionsThe options to use for this evaluation.

Returns

A Json.Schema.EvaluationResults that provides the outcome of the evaluation.

Examples(this JsonSchemaBuilder builder, IEnumerable<JsonNode> elements)

Add an examples keyword.

Declaration

1
public static JsonSchemaBuilder Examples(this JsonSchemaBuilder builder, IEnumerable<JsonNode> elements)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
elementsIEnumerable<JsonNode>The example values.

Returns

The builder.

Examples(this JsonSchemaBuilder builder, params JsonNode[] elements)

Add an examples keyword.

Declaration

1
public static JsonSchemaBuilder Examples(this JsonSchemaBuilder builder, params JsonNode[] elements)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
elementsparams JsonNode[]The example values.

Returns

The builder.

ExclusiveMaximum(this JsonSchemaBuilder builder, decimal max)

Add an exclusiveMaximum keyword.

Declaration

1
public static JsonSchemaBuilder ExclusiveMaximum(this JsonSchemaBuilder builder, decimal max)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
maxdecimalThe max value.

Returns

The builder.

ExclusiveMinimum(this JsonSchemaBuilder builder, decimal min)

Add an exclusiveMinimum keyword.

Declaration

1
public static JsonSchemaBuilder ExclusiveMinimum(this JsonSchemaBuilder builder, decimal min)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
mindecimalThe min value.

Returns

The builder.

Format(this JsonSchemaBuilder builder, string format)

Add a format keyword.

Declaration

1
public static JsonSchemaBuilder Format(this JsonSchemaBuilder builder, string format)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
formatstringThe format.

Returns

The builder.

Format(this JsonSchemaBuilder builder, Format format)

Add a format keyword.

Declaration

1
public static JsonSchemaBuilder Format(this JsonSchemaBuilder builder, Format format)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
formatFormatThe format.

Returns

The builder.

Id(this JsonSchemaBuilder builder, Uri id)

Add an $id keyword.

Declaration

1
public static JsonSchemaBuilder Id(this JsonSchemaBuilder builder, Uri id)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
idUriThe ID.

Returns

The builder.

Id(this JsonSchemaBuilder builder, string id)

Add an $id keyword.

Declaration

1
public static JsonSchemaBuilder Id(this JsonSchemaBuilder builder, string id)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
idstringThe ID.

Returns

The builder.

If(this JsonSchemaBuilder builder, JsonSchema schema)

Add an if keyword.

Declaration

1
public static JsonSchemaBuilder If(this JsonSchemaBuilder builder, JsonSchema schema)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
schemaJsonSchemaThe schema for if.

Returns

The builder.

Items(this JsonSchemaBuilder builder, JsonSchema schema)

Add a single-schema items keyword.

Declaration

1
public static JsonSchemaBuilder Items(this JsonSchemaBuilder builder, JsonSchema schema)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
schemaJsonSchemaThe schema for items.

Returns

The builder.

Items(this JsonSchemaBuilder builder, IEnumerable<JsonSchema> schemas)

Add a schema-array items keyword.

Declaration

1
public static JsonSchemaBuilder Items(this JsonSchemaBuilder builder, IEnumerable<JsonSchema> schemas)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
schemasIEnumerable<JsonSchema>The schemas for items.

Returns

The builder.

MaxContains(this JsonSchemaBuilder builder, uint value)

Add a maxContains keyword.

Declaration

1
public static JsonSchemaBuilder MaxContains(this JsonSchemaBuilder builder, uint value)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
valueuintThe max number of expected matches.

Returns

The builder.

Maximum(this JsonSchemaBuilder builder, decimal value)

Add a maximum keyword.

Declaration

1
public static JsonSchemaBuilder Maximum(this JsonSchemaBuilder builder, decimal value)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
valuedecimalThe max value.

Returns

The builder.

MaxItems(this JsonSchemaBuilder builder, uint value)

Add a maxItems keyword.

Declaration

1
public static JsonSchemaBuilder MaxItems(this JsonSchemaBuilder builder, uint value)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
valueuintThe max number of expected items.

Returns

The builder.

MaxLength(this JsonSchemaBuilder builder, uint value)

Add a maxLength keyword.

Declaration

1
public static JsonSchemaBuilder MaxLength(this JsonSchemaBuilder builder, uint value)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
valueuintThe max string length.

Returns

The builder.

MaxProperties(this JsonSchemaBuilder builder, uint value)

Add a maxProperties keyword.

Declaration

1
public static JsonSchemaBuilder MaxProperties(this JsonSchemaBuilder builder, uint value)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
valueuintThe max number of expected properties.

Returns

The builder.

MinContains(this JsonSchemaBuilder builder, uint value)

Add a minContains keyword.

Declaration

1
public static JsonSchemaBuilder MinContains(this JsonSchemaBuilder builder, uint value)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
valueuintThe min number of expected matches.

Returns

The builder.

Minimum(this JsonSchemaBuilder builder, decimal value)

Add a minimum keyword.

Declaration

1
public static JsonSchemaBuilder Minimum(this JsonSchemaBuilder builder, decimal value)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
valuedecimalThe min value.

Returns

The builder.

MinItems(this JsonSchemaBuilder builder, uint value)

Add a minItems keyword.

Declaration

1
public static JsonSchemaBuilder MinItems(this JsonSchemaBuilder builder, uint value)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
valueuintThe min number of expected items.

Returns

The builder.

MinLength(this JsonSchemaBuilder builder, uint value)

Add a minLength keyword.

Declaration

1
public static JsonSchemaBuilder MinLength(this JsonSchemaBuilder builder, uint value)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
valueuintThe min string length.

Returns

The builder.

MinProperties(this JsonSchemaBuilder builder, uint value)

Add a minProperties keyword.

Declaration

1
public static JsonSchemaBuilder MinProperties(this JsonSchemaBuilder builder, uint value)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
valueuintThe min number of expected properties.

Returns

The builder.

MultipleOf(this JsonSchemaBuilder builder, decimal value)

Add a multipleOf keyword.

Declaration

1
public static JsonSchemaBuilder MultipleOf(this JsonSchemaBuilder builder, decimal value)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
valuedecimalThe divisor.

Returns

The builder.

Not(this JsonSchemaBuilder builder, JsonSchema schema)

Add a not keyword.

Declaration

1
public static JsonSchemaBuilder Not(this JsonSchemaBuilder builder, JsonSchema schema)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
schemaJsonSchemaThe schema for not.

Returns

The builder.

OneOf(this JsonSchemaBuilder builder, params JsonSchema[] schemas)

Add a oneOf keyword.

Declaration

1
public static JsonSchemaBuilder OneOf(this JsonSchemaBuilder builder, params JsonSchema[] schemas)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
schemasparams JsonSchema[]The schema for oneOf.

Returns

The builder.

OneOf(this JsonSchemaBuilder builder, IEnumerable<JsonSchema> schemas)

Add a oneOf keyword.

Declaration

1
public static JsonSchemaBuilder OneOf(this JsonSchemaBuilder builder, IEnumerable<JsonSchema> schemas)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
schemasIEnumerable<JsonSchema>The schemas for oneOf.

Returns

The builder.

Pattern(this JsonSchemaBuilder builder, Regex pattern)

Add a pattern keyword.

Declaration

1
public static JsonSchemaBuilder Pattern(this JsonSchemaBuilder builder, Regex pattern)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
patternRegexThe Regex instance to match.

Returns

The builder.

Pattern(this JsonSchemaBuilder builder, string pattern)

Add a pattern keyword.

Declaration

1
public static JsonSchemaBuilder Pattern(this JsonSchemaBuilder builder, string pattern)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
patternstringThe pattern to match.

Returns

The builder.

PatternProperties(this JsonSchemaBuilder builder, IReadOnlyDictionary<Regex, JsonSchema> props)

Add a patternProperties keyword.

Declaration

1
public static JsonSchemaBuilder PatternProperties(this JsonSchemaBuilder builder, IReadOnlyDictionary<Regex, JsonSchema> props)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
propsIReadOnlyDictionary<Regex, JsonSchema>The property schemas.

Returns

The builder.

PatternProperties(this JsonSchemaBuilder builder, params (Regex pattern, JsonSchema schema)[] props)

Add a patternProperties keyword.

Declaration

1
public static JsonSchemaBuilder PatternProperties(this JsonSchemaBuilder builder, params (Regex pattern, JsonSchema schema)[] props)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
propsparams (Regex pattern, JsonSchema schema)[]The property schemas.

Returns

The builder.

PatternProperties(this JsonSchemaBuilder builder, IReadOnlyDictionary<string, JsonSchema> props)

Add a patternProperties keyword.

Declaration

1
public static JsonSchemaBuilder PatternProperties(this JsonSchemaBuilder builder, IReadOnlyDictionary<string, JsonSchema> props)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
propsIReadOnlyDictionary<string, JsonSchema>The property schemas.

Returns

The builder.

PatternProperties(this JsonSchemaBuilder builder, params (string pattern, JsonSchema schema)[] props)

Add a patternProperties keyword.

Declaration

1
public static JsonSchemaBuilder PatternProperties(this JsonSchemaBuilder builder, params (string pattern, JsonSchema schema)[] props)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
propsparams (string pattern, JsonSchema schema)[]The property schemas.

Returns

The builder.

PrefixItems(this JsonSchemaBuilder builder, params JsonSchema[] schemas)

Add a prefixItems keyword.

Declaration

1
public static JsonSchemaBuilder PrefixItems(this JsonSchemaBuilder builder, params JsonSchema[] schemas)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
schemasparams JsonSchema[]The schemas for prefixItems.

Returns

The builder.

PrefixItems(this JsonSchemaBuilder builder, IEnumerable<JsonSchema> schemas)

Add a prefixItems keyword.

Declaration

1
public static JsonSchemaBuilder PrefixItems(this JsonSchemaBuilder builder, IEnumerable<JsonSchema> schemas)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
schemasIEnumerable<JsonSchema>The schemas for prefixItems.

Returns

The builder.

Properties(this JsonSchemaBuilder builder, IReadOnlyDictionary<string, JsonSchema> props)

Add a properties keyword.

Declaration

1
public static JsonSchemaBuilder Properties(this JsonSchemaBuilder builder, IReadOnlyDictionary<string, JsonSchema> props)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
propsIReadOnlyDictionary<string, JsonSchema>The property schemas.

Returns

The builder.

Properties(this JsonSchemaBuilder builder, params (string name, JsonSchema schema)[] props)

Add a properties keyword.

Declaration

1
public static JsonSchemaBuilder Properties(this JsonSchemaBuilder builder, params (string name, JsonSchema schema)[] props)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
propsparams (string name, JsonSchema schema)[]The property schemas.

Returns

The builder.

PropertyDependencies(this JsonSchemaBuilder builder, IReadOnlyDictionary<string, PropertyDependency> dependencies)

Adds a propertyDependencies keyword.

Declaration

1
public static JsonSchemaBuilder PropertyDependencies(this JsonSchemaBuilder builder, IReadOnlyDictionary<string, PropertyDependency> dependencies)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
dependenciesIReadOnlyDictionary<string, PropertyDependency>The property dependency schemas.

Returns

The builder.

PropertyDependencies(this JsonSchemaBuilder builder, params (string property, PropertyDependency dependency)[] dependencies)

Adds a propertyDependencies keyword.

Declaration

1
public static JsonSchemaBuilder PropertyDependencies(this JsonSchemaBuilder builder, params (string property, PropertyDependency dependency)[] dependencies)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
dependenciesparams (string property, PropertyDependency dependency)[]The property dependency schemas.

Returns

The builder.

PropertyNames(this JsonSchemaBuilder builder, JsonSchema schema)

Add a propertyNames keyword.

Declaration

1
public static JsonSchemaBuilder PropertyNames(this JsonSchemaBuilder builder, JsonSchema schema)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
schemaJsonSchemaThe schema for propertyNames.

Returns

The builder.

ReadOnly(this JsonSchemaBuilder builder, bool value)

Add a readOnly keyword.

Declaration

1
public static JsonSchemaBuilder ReadOnly(this JsonSchemaBuilder builder, bool value)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
valueboolWhether the instance is read-only.

Returns

The builder.

RecursiveAnchor(this JsonSchemaBuilder builder, bool value)

Add a $recursiveAnchor keyword.

Declaration

1
public static JsonSchemaBuilder RecursiveAnchor(this JsonSchemaBuilder builder, bool value)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
valueboolThe value.

Returns

The builder.

Remarks

Per Draft 2019-09, the value must always be true. This is implied for this method.

RecursiveRef(this JsonSchemaBuilder builder, Uri reference)

Add a $recursiveRef keyword.

Declaration

1
public static JsonSchemaBuilder RecursiveRef(this JsonSchemaBuilder builder, Uri reference)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
referenceUriThe URI reference.

Returns

The builder.

RecursiveRef(this JsonSchemaBuilder builder, string reference)

Add a $recursiveRef keyword.

Declaration

1
public static JsonSchemaBuilder RecursiveRef(this JsonSchemaBuilder builder, string reference)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
referencestringThe URI reference.

Returns

The builder.

Ref(this JsonSchemaBuilder builder, Uri reference)

Add a $ref keyword.

Declaration

1
public static JsonSchemaBuilder Ref(this JsonSchemaBuilder builder, Uri reference)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
referenceUriThe URI reference.

Returns

The builder.

Ref(this JsonSchemaBuilder builder, string reference)

Add a $ref keyword.

Declaration

1
public static JsonSchemaBuilder Ref(this JsonSchemaBuilder builder, string reference)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
referencestringThe URI reference.

Returns

The builder.

Required(this JsonSchemaBuilder builder, IEnumerable<string> properties)

Add a required keyword.

Declaration

1
public static JsonSchemaBuilder Required(this JsonSchemaBuilder builder, IEnumerable<string> properties)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
propertiesIEnumerable<string>The required property collections.

Returns

The builder.

Required(this JsonSchemaBuilder builder, params string[] properties)

Add a required keyword.

Declaration

1
public static JsonSchemaBuilder Required(this JsonSchemaBuilder builder, params string[] properties)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
propertiesparams string[]The required property collections.

Returns

The builder.

Schema(this JsonSchemaBuilder builder, Uri uri)

Add a $schema keyword.

Declaration

1
public static JsonSchemaBuilder Schema(this JsonSchemaBuilder builder, Uri uri)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
uriUriThe uri of the meta-schema.

Returns

The builder.

Schema(this JsonSchemaBuilder builder, string uri)

Add a $schema keyword.

Declaration

1
public static JsonSchemaBuilder Schema(this JsonSchemaBuilder builder, string uri)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
uristringThe uri of the meta-schema.

Returns

The builder.

Then(this JsonSchemaBuilder builder, JsonSchema schema)

Add a then keyword.

Declaration

1
public static JsonSchemaBuilder Then(this JsonSchemaBuilder builder, JsonSchema schema)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
schemaJsonSchemaThe schema for then.

Returns

The builder.

Title(this JsonSchemaBuilder builder, string title)

Add a title keyword.

Declaration

1
public static JsonSchemaBuilder Title(this JsonSchemaBuilder builder, string title)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
titlestringThe title.

Returns

The builder.

Type(this JsonSchemaBuilder builder, SchemaValueType type)

Add a type keyword.

Declaration

1
public static JsonSchemaBuilder Type(this JsonSchemaBuilder builder, SchemaValueType type)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
typeSchemaValueTypeThe type. Can be combined with the bit-wise OR operator \|.

Returns

The builder.

Type(this JsonSchemaBuilder builder, params SchemaValueType[] types)

Add a type keyword.

Declaration

1
public static JsonSchemaBuilder Type(this JsonSchemaBuilder builder, params SchemaValueType[] types)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
typesparams SchemaValueType[]The types.

Returns

The builder.

Type(this JsonSchemaBuilder builder, IEnumerable<SchemaValueType> types)

Add a type keyword.

Declaration

1
public static JsonSchemaBuilder Type(this JsonSchemaBuilder builder, IEnumerable<SchemaValueType> types)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
typesIEnumerable<SchemaValueType>The types.

Returns

The builder.

UnevaluatedItems(this JsonSchemaBuilder builder, JsonSchema schema)

Add an unevaluatedItems keyword.

Declaration

1
public static JsonSchemaBuilder UnevaluatedItems(this JsonSchemaBuilder builder, JsonSchema schema)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
schemaJsonSchemaThe schema for unevaluatedItems.

Returns

The builder.

UnevaluatedProperties(this JsonSchemaBuilder builder, JsonSchema schema)

Add an unevaluatedProperties keyword.

Declaration

1
public static JsonSchemaBuilder UnevaluatedProperties(this JsonSchemaBuilder builder, JsonSchema schema)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
schemaJsonSchemaThe schema for unevaluatedProperties.

Returns

The builder.

UniqueItems(this JsonSchemaBuilder builder, bool value)

Add a uniqueItems keyword.

Declaration

1
public static JsonSchemaBuilder UniqueItems(this JsonSchemaBuilder builder, bool value)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
valueboolWhether to expect a unique item set.

Returns

The builder.

Unrecognized(this JsonSchemaBuilder builder, string name, JsonNode value)

Adds a keyword that’s not recognized by any vocabulary - extra data - to the schema.

Declaration

1
public static JsonSchemaBuilder Unrecognized(this JsonSchemaBuilder builder, string name, JsonNode value)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
namestringThe keyword name.
valueJsonNodeThe value.

Returns

The builder.

Vocabulary(this JsonSchemaBuilder builder, params (Uri id, bool required)[] vocabs)

Add an $vocabulary keyword.

Declaration

1
public static JsonSchemaBuilder Vocabulary(this JsonSchemaBuilder builder, params (Uri id, bool required)[] vocabs)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
vocabsparams (Uri id, bool required)[]The vocabulary callouts.

Returns

The builder.

Vocabulary(this JsonSchemaBuilder builder, params (string id, bool required)[] vocabs)

Add an $vocabulary keyword.

Declaration

1
public static JsonSchemaBuilder Vocabulary(this JsonSchemaBuilder builder, params (string id, bool required)[] vocabs)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
vocabsparams (string id, bool required)[]The vocabulary callouts.

Returns

The builder.

Vocabulary(this JsonSchemaBuilder builder, IReadOnlyDictionary<Uri, bool> vocabs)

Add an $vocabulary keyword.

Declaration

1
public static JsonSchemaBuilder Vocabulary(this JsonSchemaBuilder builder, IReadOnlyDictionary<Uri, bool> vocabs)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
vocabsIReadOnlyDictionary<Uri, bool>The vocabulary callouts.

Returns

The builder.

Vocabulary(this JsonSchemaBuilder builder, IReadOnlyDictionary<string, bool> vocabs)

Add an $vocabulary keyword.

Declaration

1
public static JsonSchemaBuilder Vocabulary(this JsonSchemaBuilder builder, IReadOnlyDictionary<string, bool> vocabs)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
vocabsIReadOnlyDictionary<string, bool>The vocabulary callouts.

Returns

The builder.

WriteOnly(this JsonSchemaBuilder builder, bool value)

Add a writeOnly keyword.

Declaration

1
public static JsonSchemaBuilder WriteOnly(this JsonSchemaBuilder builder, bool value)
ParameterTypeDescription
builderJsonSchemaBuilderThe builder.
valueboolWhether the instance is write-only.

Returns

The builder.

Contents