martin-g commented on code in PR #1775:
URL: https://github.com/apache/avro/pull/1775#discussion_r926497784
##########
lang/rust/avro/src/schema.rs:
##########
@@ -2030,6 +2030,44 @@ mod tests {
assert_eq!(schema_c, schema_c_expected);
}
+ // AVRO-3584 : recursion in type definitions
+ #[test]
+ fn avro_3584_test_recursion_records() {
+ // A and B are the same except the name.
+ let schema_str_a = r#"{
+ "name": "A",
+ "type": "record",
+ "fields": [ {"name": "field_one", "type": "B"} ]
+ }"#;
+
+ let schema_str_b = r#"{
+ "name": "B",
+ "type": "record",
+ "fields": [ {"name": "field_one", "type": "A"} ]
+ }"#;
+
+ let list = Schema::parse_list(&[schema_str_a, schema_str_b])
+ .unwrap();
+
+ let schema_a = list
+ .first()
+ .unwrap()
+ .clone();
+
+ match schema_a {
+ Schema::Record { fields, .. } => {
+ let f1 = fields.get(0);
+
+ let refSchema = Schema::Ref {
Review Comment:
in the previous run `clippy` complained that `refSchema` should be
`ref_schema`, but it didn't complain in this run ...
Strange.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]