Fernando Moraes created AVRO-2100:
-------------------------------------

             Summary: Nullable fields based on own annotations
                 Key: AVRO-2100
                 URL: https://issues.apache.org/jira/browse/AVRO-2100
             Project: Avro
          Issue Type: Wish
          Components: java
    Affects Versions: 1.8.2
            Reporter: Fernando Moraes
            Priority: Trivial


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:

{code:java}
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);
{code}

thank you all




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to