Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-2243

Add support for adding Union types for a Class without @Union annotation when not possible to mutate the class

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Patch Available
    • Minor
    • Resolution: Unresolved
    • 1.8.2
    • None
    • java

    Description

      This patch facilitates the addition of Union types for a given class. This is equivalent to adding an @Union annotation with values. But this can help in cases where you cannot mutate the class to annotate it (or don't want to use java-agent to transform/mutate the class at runtime). 

      UseCase:

      In our project, we are using ReflectData to generate schema for external jar imported classes which cannot be mutated. In this scenario, we cannot add @Union annotation to the base class to add all implemenations of the derived classes. So, when generating schema, the derived classes are not included.

      This patch will enable us to add the union type information so that ReflectData can generate the schema with union types also in it.

      Please let us know if you have any questions. I would make corresponding changes. Thanks

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vamsi360 Vamsi Subhash Achanta
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: