Skip to main content

validate_yaml_core_schema

Function validate_yaml_core_schema 

Source
pub fn validate_yaml_core_schema(value: &Value) -> Result<()>
Expand description

Validate a value against the YAML 1.2 Core Schema.

The core schema is the default YAML schema and is the most flexible. It supports all JSON schema types plus:

  • NaN and Infinity for floats
  • Tagged values with standard YAML tags

§Errors

Returns an error only for malformed values (this is very permissive).

§Examples

use noyalib::{validate_yaml_core_schema, Value};

// Core schema accepts everything
let value = Value::from(f64::NAN);
assert!(validate_yaml_core_schema(&value).is_ok());

let null = Value::Null;
assert!(validate_yaml_core_schema(&null).is_ok());