JsonSchemaValidator class

Validates instances against one schema.

Constructors

JsonSchemaValidator(Object? schema, {Map<String, Object?> registry = const {}, JsonSchemaDialect defaultDialect = JsonSchemaDialect.draft2020, JsonSchemaLimits limits = const JsonSchemaLimits(), bool assertFormat = false, String baseUri = 'urn:mcp:schema'})
Builds the validator, refusing a schema it cannot evaluate faithfully.

Properties

assertFormat → bool
final
dialect → JsonSchemaDialect
The dialect the schema is evaluated in.
no setter
hashCode → int
The hash code for this object.
no setterinherited
limits → JsonSchemaLimits
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
validate(Object? instance) → JsonSchemaResult
Validate instance; the schema itself was checked when built.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

checkSchema(Object? schema, {JsonSchemaDialect defaultDialect = JsonSchemaDialect.draft2020}) → JsonSchemaResult
Whether schema is itself valid against its dialect's meta-schema.