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

Nullable fields based on own annotations

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • 1.8.2
    • None
    • java
    • None

    Description

      Hello! first of all, congratulations on the project.

      I am generating avro schemas from java class, and my class already have annotations referring to not null. I would like to know if it is possible to somehow override the default behavior to define the nullable in the schema.

      My code looks like this:

      public class MyJavaClass {
      	
      	@javax.validation.constraints.NotNull // This is necessary for my project.
      	@org.apache.avro.reflect.Nullable // I wanted to avoid having to use this annotation
      	private String field;
      
      }
      
      Schema schema = ReflectData.get().getSchema(MyJavaClass.class);
      

      thank you all

      Attachments

        Activity

          People

            Unassigned Unassigned
            fernandosdemoraes Fernando Moraes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: