jsonschema

Module draft4

source
Expand description

Functionality specific to JSON Schema Draft 4.

Draft 4

This module provides functions for creating validators and performing validation according to the JSON Schema Draft 4 specification.

§Examples

use serde_json::json;

let schema = json!({"type": "number", "multipleOf": 2});
let instance = json!(4);

assert!(jsonschema::draft4::is_valid(&schema, &instance));

Functions§

  • Validate an instance against a schema using Draft 4 specifications without creating a validator.
  • Create a new JSON Schema validator using Draft 4 specifications.
  • Creates a ValidationOptions builder pre-configured for JSON Schema Draft 4.