Description
Hi guys,
I've got a simple app using Avro Reflection:
public class App { public static void main(String[] args) { testReflection(); } static class User { public String first = "Andy"; public String last = "Le"; } static void testReflection(){ // get the reflected schema for packets Schema schema = ReflectData.AllowNull.get().getSchema(User.class); System.out.println(schema.toString(true)); }
The output on console will be:
{ "type" : "record", "name" : "User", "namespace" : "App", "fields" : [ { "name" : "first", "type" : [ "null", "string" ], "default" : null }, { "name" : "last", "type" : [ "null", "string" ], "default" : null } ] }
As you can see, there's no default values for fields. Would you please tell me how to obtain such values?
Thank you.
Attachments
Attachments
Issue Links
- links to