pub fn patternProperties(
    cfg: &Config,
    instance: &Value,
    schema: &Value,
    _parent_schema: &Map<String, Value>,
    instance_ctx: &Context,
    schema_ctx: &Context,
    ref_ctx: &Context,
    errors: &mut ErrorRecorder,
) -> Option<()> {
    if let (Object(instance), Object(schema)) = (instance, schema) {
        for (pattern, subschema) in schema.iter() {
            if let Ok(re) = regex::Regex::new(pattern) {
                for (k, v) in instance.iter() {
                    if re.is_match(k) {
                        descend(
                            cfg,
                            v,
                            subschema,
                            &instance_ctx.push(&k.clone().into()),
                            &schema_ctx.push(&pattern.clone().into()),
                            ref_ctx,
                            errors,
                        )?;
                    }
                }
            }
        }
    }
    Some(())
}
// The validation functions below all correspond to individual schema checks
// defined in the JSON schema specification.
The validation functions below all correspond to individual schema checks
defined in the JSON schema specification.
The validation functions below all correspond to individual schema checks defined in the JSON schema specification .
pub fn patternProperties(
    cfg: &Config,
    instance: &Value,
    schema: &Value,
    _parent_schema: &Map<String, Value>,
    instance_ctx: &Context,
    schema_ctx: &Context,
    ref_ctx: &Context,
    errors: &mut ErrorRecorder,
) -> Option<()> {
    if let (Object(instance), Object(schema)) = (instance, schema) {
        for (pattern, subschema) in schema.iter() {
            if let Ok(re) = regex::Regex::new(pattern) {
                for (k, v) in instance.iter() {
                    if re.is_match(k) {
                        descend(
                            cfg,
                            v,
                            subschema,
                            &instance_ctx.push(&k.clone().into()),
                            &schema_ctx.push(&pattern.clone().into()),
                            ref_ctx,
                            errors,
                        )?;
                    }
                }
            }
        }
    }
    Some(())
}
pub fn patternProperties ( cfg : & Config , instance : & Value , schema : & Value , _parent_schema : & Map < String , Value > , instance_ctx : & Context , schema_ctx : & Context , ref_ctx : & Context , errors : & mut ErrorRecorder , ) -> Option < ( ) > { if let ( Object ( instance ) , Object ( schema ) ) = ( instance , schema ) { for ( pattern , subschema ) in schema . iter ( ) { if let Ok ( re ) = regex :: Regex :: new ( pattern ) { for ( k , v ) in instance . iter ( ) { if re . is_match ( k ) { descend ( cfg , v , subschema , & instance_ctx . push ( & k . clone ( ) . into ( ) ) , & schema_ctx . push ( & pattern . clone ( ) . into ( ) ) , ref_ctx , errors , ) ? ; } } } } } Some ( ( ) ) }
The validation functions below all correspond to individual schema checks
defined in the JSON schema specification.
The validation functions below all correspond to individual schema checks defined in the JSON schema specification .
cfg
&Config
instance
&Value
schema
&Value
_parent_schema
&Map<String, Value>
instance_ctx
&Context
schema_ctx
&Context
ref_ctx
&Context
errors
&mut ErrorRecorder
cfg
&Config
instance
&Value
schema
&Value
_parent_schema
&Map<String, Value>
instance_ctx
&Context
schema_ctx
&Context
ref_ctx
&Context
errors
&mut ErrorRecorder