[−][src]Function jsonschema_valid::is_valid
pub fn is_valid(
instance: &Value,
schema: &Value,
draft: Option<&dyn Draft>,
validate_schema: bool
) -> bool
Validates a given JSON instance against a given JSON schema, returning true if valid. This function is more efficient than validate or validate_to_stream, because it stops at the first error.
Arguments
instance
: The JSON document to validateschema
: The JSON schema to validate againstdraft
: The draft of the JSON schema specification to use. IfNone
, the draft will be automatically determined from theschema
.validate_schema
: Whentrue
, validate the schema against the metaschema first.
Returns
true
:instance
is valid againstschema
.