MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / parse_array

Method parse_array

src/avro/src/schema.rs:1249–1259  ·  view source on GitHub ↗

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

(
        &mut self,
        default_namespace: &str,
        complex: &Map<String, Value>,
    )

Source from the content-addressed store, hash-verified

1247 /// Parse a `serde_json::Value` representing a Avro array type into a
1248 /// `Schema`.
1249 fn parse_array(
1250 &mut self,
1251 default_namespace: &str,
1252 complex: &Map<String, Value>,
1253 ) -> Result<SchemaPiece, AvroError> {
1254 complex
1255 .get("items")
1256 .ok_or_else(|| ParseSchemaError::new("No `items` in array").into())
1257 .and_then(|items| self.parse_inner(default_namespace, items))
1258 .map(|schema| SchemaPiece::Array(Box::new(schema)))
1259 }
1260
1261 /// Parse a `serde_json::Value` representing a Avro map type into a
1262 /// `Schema`.

Callers 1

parse_complexMethod · 0.45

Calls 4

ArrayClass · 0.85
parse_innerMethod · 0.80
mapMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected