[][src]Function jsonschema_valid::validate_to_stream

pub fn validate_to_stream(
    stream: &mut dyn Write,
    instance: &Value,
    schema: &Value,
    draft: Option<&dyn Draft>,
    validate_schema: bool
) -> Option<()>

Validates a given JSON instance against a given JSON schema, writing the errors to the given stream. draft may provide the schema draft to use. If not provided, it will be determined automatically from the schema.

Arguments

  • stream: An object to write errors to.
  • instance: The JSON document to validate
  • schema: The JSON schema to validate against
  • draft: The draft of the JSON schema specification to use. If None, the draft will be automatically determined from the schema.
  • validate_schema: When true, validate the schema against the metaschema first.

Returns

  • Some(()): No errors were found.
  • None: At least one error was found.