Home KeywordConstraint Class
KeywordConstraint Class
Cancel

KeywordConstraint Class

Namespace: Json.Schema

Inheritance: KeywordConstraint 🡒 object

Describes the constraint applied by a single keyword.

Remarks

This represents any work that can be performed as part of static analysis of the schema.

Properties

NameTypeSummary
ChildDependenciesSchemaConstraint[]Gets or sets the collection of schema constraints (i.e. subschemas) that this keyword is dependent upon. The evaluations of these constraints will be available when this keyword is evaluated.
EvaluatorAction<KeywordEvaluation, EvaluationContext>A method that used to apply the actual constraint behavior.
KeywordstringThe keyword name.
SiblingDependenciesKeywordConstraint[]Gets or sets the collection of keyword constraints (i.e. sibling keywords) that this keyword is dependent upon. The evaluations of these constraints will be available when this keyword is evaluated.
SkipKeywordConstraintGets a no-op constraint. Use for keywords that have no assertion or annotation behavior, e.g. $defs.

Constructors

KeywordConstraint(string keyword, Action<KeywordEvaluation, EvaluationContext> evaluator)

Creates a new keyword constraint.

Declaration

1
public KeywordConstraint(string keyword, Action<KeywordEvaluation, EvaluationContext> evaluator)
ParameterTypeDescription
keywordstringThe keyword name.
evaluatorAction<KeywordEvaluation, EvaluationContext>A method that used to apply the actual constraint behavior.

Methods

SimpleAnnotation(string keyword, JsonNode value)

Creates a keyword constraint that simply applies an annotation.

Declaration

1
public static KeywordConstraint SimpleAnnotation(string keyword, JsonNode value)
ParameterTypeDescription
keywordstringThe keyword name.
valueJsonNodeThe annotation value.

Returns

A new keyword constraint.

Contents