Home EvaluationResults Class
EvaluationResults Class
Cancel

EvaluationResults Class

Namespace: Json.Schema

Inheritance: EvaluationResults 🡒 object

The results object for evaluations.

Properties

NameTypeSummary
AnnotationsIReadOnlyDictionary<string, JsonNode>The collection of annotations from this node.
DetailsIReadOnlyList<EvaluationResults>The collection of nested results.
ErrorsIReadOnlyDictionary<string, string>The collection of error from this node.
EvaluationPathJsonPointerThe schema location that generated this node.
HasAnnotationsboolGets whether this node has annotations.
HasDetailsboolGets whether there are nested results.
HasErrorsboolGets whether this node has errors.
InstanceLocationJsonPointerThe instance location that was processed.
IsValidboolIndicates whether the validation passed or failed.
ParentEvaluationResultsGets the parent result.
SchemaLocationUriThe absolute schema location.

Methods

Fail()

Marks the result as invalid.

Declaration

1
public void Fail()

Remarks

For better support for customization, consider using the overload that takes parameters.

Fail(string keyword, string message)

Marks the result as invalid.

Declaration

1
public void Fail(string keyword, string message)
ParameterTypeDescription
keywordstringThe keyword that failed validation.
messagestringAn error message.

Remarks

For better support for customization, consider using the overload that takes parameters.

GetAllAnnotations(string keyword)

Gets all annotations of a particular data type for the current evaluation level.

Declaration

1
public IEnumerable<JsonNode> GetAllAnnotations(string keyword)
ParameterTypeDescription
keywordstringThe key under which the annotation is stored. Typically a keyword.

Returns

The set of all annotations for the current evaluation level.

SetAnnotation(string keyword, JsonNode value)

Sets an annotation.

Declaration

1
public void SetAnnotation(string keyword, JsonNode value)
ParameterTypeDescription
keywordstringThe annotation key. Typically the name of the keyword.
valueJsonNodeThe annotation value.

ToFlag()

Transforms the results to the flag format.

Declaration

1
public void ToFlag()

ToList()

Transforms the results to the basic format.

Declaration

1
public void ToList()

TryGetAnnotation(string keyword, out JsonNode annotation)

Tries to get an annotation.

Declaration

1
public bool TryGetAnnotation(string keyword, out JsonNode annotation)
ParameterTypeDescription
keywordstringThe annotation key.
annotationout JsonNode 

Returns

The annotation or null.

Contents