fn fill_properties(map: &mut Map<String, Value>, properties_types: &BTreeMap<String, Vec<&Value>>) {
    let properties = map
        .entry("properties")
        .or_insert(json!({}))
        .as_object_mut()
        .unwrap();
    for (property, known_types) in properties_types.iter() {
        let types = {
            if known_types.len() == 1 {
                json!(known_types.first())
            } else {
                json!({ "anyOf": known_types })
            }
        };
        properties.insert(property.clone(), types);
    }
}
/// Fill "properties" with collected values.
/// Each property can be either of one type or multiple types joined via "anyOf"
Fill "properties" with collected values.
Each property can be either of one type or multiple types joined via "anyOf"
Fill " properties " with collected values . Each property can be either of one type or multiple types joined via " anyOf "
fn fill_properties(map: &mut Map<String, Value>, properties_types: &BTreeMap<String, Vec<&Value>>) {
    let properties = map
        .entry("properties")
        .or_insert(json!({}))
        .as_object_mut()
        .unwrap();
    for (property, known_types) in properties_types.iter() {
        let types = {
            if known_types.len() == 1 {
                json!(known_types.first())
            } else {
                json!({ "anyOf": known_types })
            }
        };
        properties.insert(property.clone(), types);
    }
}
fn fill_properties ( map : & mut Map < String , Value > , properties_types : & BTreeMap < String , Vec < & Value > > ) { let properties = map . entry ( " " ) . or_insert ( json ! ( { } ) ) . as_object_mut ( ) . unwrap ( ) ; for ( property , known_types ) in properties_types . iter ( ) { let types = { if known_types . len ( ) == 1 { json ! ( known_types first ( ) ) } else { json ! ( { " " known_types } ) } } ; properties . insert ( property . clone ( ) , types ) ; } }
Fill "properties" with collected values.
Fill " properties " with collected values .
map
&mut Map<String, Value>
properties_types
&BTreeMap<String, Vec<&Value>>