@@ -48,13 +48,13 @@ public class RecordVisitor
4848 * When _type = Fruit.class
4949 * Then
5050 * _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 : [..]}
5454 * ]
5555 * _typeSchema points to Fruit.class without subtypes record schema
5656 *
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),
5858 * but it might be considered API change cause _overridden has protected access modifier.
5959 */
6060 private Schema _typeSchema ;
@@ -108,7 +108,7 @@ public RecordVisitor(SerializerProvider p, JavaType type, VisitorFormatWrapperIm
108108 ser .acceptJsonFormatVisitor (visitor , getProvider ().getTypeFactory ().constructType (subType .getType ()));
109109 Schema subTypeSchema = visitor .getAvroSchema ();
110110 // 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
112112 if (subTypeSchema .getType () == Type .UNION ) {
113113// subTypeSchema.getTypes().stream()
114114// .filter(unionElement -> !unionSchemas.contains(unionElement))
0 commit comments