Class SchemaValidationContext
Used to track data throughout the validation process.
Inheritance
Inherited Members
Namespace: Manatee.Json.Schema
Assembly: Manatee.Json.dll
Syntax
public class SchemaValidationContext
Constructors
| Improve this Doc View SourceSchemaValidationContext(SchemaValidationContext)
Creates a new instance of the SchemaValidationContext class by copying values from another instance.
Declaration
public SchemaValidationContext(SchemaValidationContext source)
Parameters
Type | Name | Description |
---|---|---|
SchemaValidationContext | source |
Properties
| Improve this Doc View SourceBaseRelativeLocation
Gets or sets the current schema location relative to the current base URI (BaseUri).
Declaration
public JsonPointer? BaseRelativeLocation { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<JsonPointer> |
BaseUri
Gets or sets the base URI at this point in the validation.
Declaration
public Uri? BaseUri { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Uri> |
EvaluatedPropertyNames
Gets a list of property names that have been evaluated in this validation pass.
Declaration
public HashSet<string> EvaluatedPropertyNames { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.HashSet<System.String> |
Instance
Gets or sets the instance being validated.
Declaration
public JsonValue Instance { get; set; }
Property Value
Type | Description |
---|---|
JsonValue |
InstanceLocation
Gets or sets the current instance location.
Declaration
public JsonPointer InstanceLocation { get; set; }
Property Value
Type | Description |
---|---|
JsonPointer |
IsMetaSchemaValidation
Gets or sets whether the current validation run is for a meta-schema.
Declaration
public bool IsMetaSchemaValidation { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
LastEvaluatedIndex
Gets the last array index that has been evaluated in this validation pass.
Declaration
public int LastEvaluatedIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Local
Gets or sets the local schema at this point in the validation.
Declaration
public JsonSchema Local { get; set; }
Property Value
Type | Description |
---|---|
JsonSchema |
LocallyEvaluatedPropertyNames
Gets a list of property names that have been evaluated on the current tier of this validation pass.
Declaration
public HashSet<string> LocallyEvaluatedPropertyNames { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.HashSet<System.String> |
LocallyValidatedIndices
Gets a list of array indices that have been evaluated on the current tier of this validation pass. Used for keywords that can peer into siblings, like unevaluatedItems
.
Declaration
public HashSet<int> LocallyValidatedIndices { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.HashSet<System.Int32> |
LocalTierLastEvaluatedIndex
Gets the last array index that has been evaluated on the current tier of this validation pass.
Declaration
public int LocalTierLastEvaluatedIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Misc
Miscellaneous data. Useful for communicating results between keywords.
Declaration
public Dictionary<string, object> Misc { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.Object> |
Remarks
Use ValidationSequence to ensure that keywords are processed in the correct order so that the communication occurs properly.
Options
Gets the schema options for the current validation pass.
Declaration
public JsonSchemaOptions Options { get; }
Property Value
Type | Description |
---|---|
JsonSchemaOptions |
RecursiveAnchor
Gets or sets the recursive anchor (root).
Declaration
public JsonSchema? RecursiveAnchor { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<JsonSchema> |
RelativeLocation
Gets or sets the current schema keyword location relative to the original schema root.
Declaration
public JsonPointer RelativeLocation { get; set; }
Property Value
Type | Description |
---|---|
JsonPointer |
Root
Gets or sets the root schema when validation begins.
Declaration
public JsonSchema Root { get; set; }
Property Value
Type | Description |
---|---|
JsonSchema |
ShouldTrackValidatedValues
Get or set if the validations for this context should track which values have been validated.
Declaration
public bool ShouldTrackValidatedValues { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
By default, this is set to true if any keywords present in the schema implement IRequireAnnotations.
ValidatedIndices
Gets a list of array indices that have been evaluated in this validation pass. Used for keywords that can peer into siblings, like unevaluatedItems
.
Declaration
public HashSet<int> ValidatedIndices { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.HashSet<System.Int32> |
Methods
| Improve this Doc View SourceUpdateEvaluatedPropertiesAndItemsFromSubschemaValidation(SchemaValidationContext)
Updates the EvaluatedPropertyNames, LocallyEvaluatedPropertyNames, LastEvaluatedIndex, and LocalTierLastEvaluatedIndex properties based on another context that processed a subschema.
Declaration
public void UpdateEvaluatedPropertiesAndItemsFromSubschemaValidation(SchemaValidationContext other)
Parameters
Type | Name | Description |
---|---|---|
SchemaValidationContext | other | Another context object. |