@@ -48,13 +48,13 @@ public class RecordVisitor
48
48
* When _type = Fruit.class
49
49
* Then
50
50
* _avroSchema if Fruit.class is union of Fruit record, Apple record and Orange record schemas: [
51
- * { name: Fruit, type: record, field : [..] }, <--- _typeSchema points here
52
- * { name: Apple, type: record, field : [..] },
53
- * { name: Orange, type: record, field : [..]}
51
+ * { name: Fruit, type: record, fields : [..] }, <--- _typeSchema points here
52
+ * { name: Apple, type: record, fields : [..] },
53
+ * { name: Orange, type: record, fields : [..]}
54
54
* ]
55
55
* _typeSchema points to Fruit.class without subtypes record schema
56
56
*
57
- * FIXME: When _thisSchema is not null, then _overridden must be true, therefore (_overridden == true) can be replaced with (_thisSchema != null),
57
+ * FIXME: When _typeSchema is not null, then _overridden must be true, therefore (_overridden == true) can be replaced with (_typeSchema != null),
58
58
* but it might be considered API change cause _overridden has protected access modifier.
59
59
*/
60
60
private Schema _typeSchema ;
@@ -108,7 +108,7 @@ public RecordVisitor(SerializerProvider p, JavaType type, VisitorFormatWrapperIm
108
108
ser .acceptJsonFormatVisitor (visitor , getProvider ().getTypeFactory ().constructType (subType .getType ()));
109
109
Schema subTypeSchema = visitor .getAvroSchema ();
110
110
// Add subType schema into this union, unless it is already there.
111
- // When subType schema is itself a union, include all its types into this union
111
+ // When subType schema is union itself , include each its type into this union if not there already
112
112
if (subTypeSchema .getType () == Type .UNION ) {
113
113
// subTypeSchema.getTypes().stream()
114
114
// .filter(unionElement -> !unionSchemas.contains(unionElement))
0 commit comments