Module: JSONSchema
- Defined in:
- lib/jsonschema/version.rb,
sig/jsonschema.rbs
Defined Under Namespace
Modules: Canonical, Meta Classes: Draft201909Validator, Draft202012Validator, Draft4Validator, Draft6Validator, Draft7Validator, EmailOptions, Evaluation, FancyRegexOptions, HttpOptions, ReferencingError, RegexOptions, Registry, Resolved, Resolver, ValidationError, ValidationErrorKind, Validator, ValidatorMap
Constant Summary collapse
- VERSION =
"0.49.4"
Class Method Summary collapse
-
.bundle ⇒ Object
Bundle a JSON Schema into a Compound Schema Document.
-
.canonicalize ⇒ Object
Reduce a schema to its canonical form.
-
.dereference ⇒ Object
Dereference a JSON Schema by recursively replacing all $ref values with the schemas they point to.
-
.each_error ⇒ Object
Iterate validation errors.
-
.evaluate ⇒ Object
One-off evaluation returning structured output.
-
.valid? ⇒ Object
One-off validation returning boolean.
-
.validate! ⇒ Object
One-off validation raising on error.
-
.validator_cls_for ⇒ singleton(Draft4Validator), ...
Detect the JSON Schema draft for a schema and return the corresponding validator class.
-
.validator_for ⇒ Object
Create a validator with auto-detected draft version.
-
.validator_map_for ⇒ Object
Create a map of validators for all sub-schemas in a JSON Schema.
Class Method Details
.bundle ⇒ Object
Bundle a JSON Schema into a Compound Schema Document. All externally-referenced schemas reachable via $ref are embedded in a draft-appropriate container (definitions for Draft 4/6/7, $defs for Draft 2019-09/2020-12). Original $ref values are preserved unchanged.
230 |
# File 'sig/jsonschema.rbs', line 230
def self.bundle: (
|
.canonicalize ⇒ Object
Reduce a schema to its canonical form.
177 |
# File 'sig/jsonschema.rbs', line 177
def self.canonicalize: (
|
.dereference ⇒ Object
Dereference a JSON Schema by recursively replacing all $ref values with the schemas they point to.
240 |
# File 'sig/jsonschema.rbs', line 240
def self.dereference: (
|
.each_error ⇒ Object
Iterate validation errors. Returns Array when no block given, nil when block given.
289 |
# File 'sig/jsonschema.rbs', line 289
def self.each_error: (
|
.evaluate ⇒ Object
One-off evaluation returning structured output.
323 |
# File 'sig/jsonschema.rbs', line 323
def self.evaluate: (
|
.valid? ⇒ Object
One-off validation returning boolean.
253 |
# File 'sig/jsonschema.rbs', line 253
def self.valid?: (
|
.validate! ⇒ Object
One-off validation raising on error.
271 |
# File 'sig/jsonschema.rbs', line 271
def self.validate!: (
|
.validator_cls_for ⇒ singleton(Draft4Validator), ...
Detect the JSON Schema draft for a schema and return the corresponding validator class.
Draft is detected automatically from the $schema field. Defaults to Draft202012Validator.
250 |
# File 'sig/jsonschema.rbs', line 250
def self.validator_cls_for: (untyped schema) -> (singleton(Draft4Validator) | singleton(Draft6Validator) | singleton(Draft7Validator) | singleton(Draft201909Validator) | singleton(Draft202012Validator))
|
.validator_for ⇒ Object
Create a validator with auto-detected draft version.
194 |
# File 'sig/jsonschema.rbs', line 194
def self.validator_for: (
|
.validator_map_for ⇒ Object
Create a map of validators for all sub-schemas in a JSON Schema.
210 |
# File 'sig/jsonschema.rbs', line 210
def self.validator_map_for: (
|