MCPcopy Create free account
hub / github.com/apache/avro-rs / parse_map

Method parse_map

avro/src/schema/parser.rs:707–721  ·  view source on GitHub ↗

Parse a `serde_json::Value` representing a Avro map type into a `Schema`.

(
        &mut self,
        complex: &Map<String, Value>,
        enclosing_namespace: NamespaceRef,
    )

Source from the content-addressed store, hash-verified

705 enclosing_namespace: NamespaceRef,
706 ) -> AvroResult<Schema> {
707 items
708 .into_iter()
709 .map(|v| self.parse(v, enclosing_namespace))
710 .collect::<Result<Vec<_>, _>>()
711 .and_then(|schemas| {
712 if schemas.is_empty() {
713 error!(
714 "Union schemas should have at least two members! \
715 Please enable debug logging to find out which Record schema \
716 declares the union with 'RUST_LOG=apache_avro::schema=debug'."
717 );
718 } else if schemas.len() == 1 {
719 warn!(
720 "Union schema with just one member! Consider dropping the union! \
721 Please enable debug logging to find out which Record schema \
722 declares the union with 'RUST_LOG=apache_avro::schema=debug'."
723 );
724 }

Callers 1

parse_complexMethod · 0.80

Calls 3

getMethod · 0.80
get_custom_attributesMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected