Hi, I forgot to mention, I'm using the java implementation of avro.
> -----Ursprüngliche Nachricht----- > Von: Alexander Zenger [mailto:[email protected]] > Gesendet: Donnerstag, 2. April 2015 10:35 > An: [email protected] > Betreff: check for required fields > > Hi, > > it seems to me that Avro does not check if non optional fields are present. > My schema looks like this: > > { > "namespace": "azen.avro.person", > "type": "record", > "name": "Person", > "fields": [ > {"name": "id", "type": "int"}, > {"name": "number", "type": "double"}, > {"name": "name", "type": "string"}, > {"name": "email", "type": ["string", "null"]}, > ] > } > > If I ommit setting the value for id or number, it works and on > deserialization a > null value ist set automatically. > If I omit the value for name, an nullpointer exception is thrown. > > Is there a way to check if the "required" fields are all set? > > -- > regards > alex
