Documentation
¶
Overview ¶
Package schematest runs independent JSON Schema contract checks in integration tests. Its pinned JavaScript dependencies are installed only in a test temp dir.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch struct {
// Schema is the complete schema, including any referenced definitions.
Schema any `json:"schema"`
// Instances are JSON values; validation never coerces or mutates them.
Instances []any `json:"instances"`
}
Batch pairs an emitted schema with the JSON instances to validate against it.
type Result ¶
type Result struct {
// Valid indicates that the schema accepted the complete instance.
Valid bool `json:"valid"`
// Errors contains independent validator diagnostics, empty on success.
Errors jsontext.Value `json:"errors"`
}
Result reports acceptance and the validator's original failure diagnostics.
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator owns a temporary Ajv installation with native ECMA-262 regexes.
Click to show internal directories.
Click to hide internal directories.