pub fn validate_yaml_failsafe_schema(value: &Value) -> Result<()>Expand description
Validate a value against the YAML 1.2 Failsafe Schema.
The failsafe schema is the most basic schema and supports only:
- Strings (tag:yaml.org,2002:str)
- Sequences (tag:yaml.org,2002:seq)
- Mappings (tag:yaml.org,2002:map)
§Errors
Returns an error if the value contains types not supported by the failsafe schema (nulls, booleans, numbers, or tagged values).
§Examples
use noyalib::{validate_yaml_failsafe_schema, Mapping, Value};
// Valid failsafe values
let valid = Value::String("hello".to_string());
assert!(validate_yaml_failsafe_schema(&valid).is_ok());
// Invalid: numbers not allowed in failsafe
let invalid = Value::from(42);
assert!(validate_yaml_failsafe_schema(&invalid).is_err());