Parse a `serde_json::Value` representing a Avro map type into a `Schema`.
(
&mut self,
complex: &Map<String, Value>,
enclosing_namespace: NamespaceRef,
)
| 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 | } |
no test coverage detected