{"id":"avro-union-no-duplicate-types","text":"A union schema cannot contain two branches with the same type name (or record name); this constraint is enforced at schema parse time in Schema._parse.","truth_value":"IN","source":"entries/2026/05/29/avro-serializer-avro_serializer.md","source_url":"","source_hash":"","justifications":[],"dependents":[],"metadata":{"example":"seen = set()\nfor t in defn:\n    key = s.name if s.name else s.type_name\n    if key in seen:\n        raise SchemaError(f\"Duplicate type in union: {key}\")\n    seen.add(key)"},"explanation":{"steps":[{"node":"avro-union-no-duplicate-types","truth_value":"IN","reason":"premise"}]}}