pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [pulsar] jerrypeng commented on issue #3741: POJO AvroSchema always allowNull
Date Mon, 04 Mar 2019 08:53:12 GMT
jerrypeng commented on issue #3741: POJO AvroSchema always allowNull
URL: https://github.com/apache/pulsar/issues/3741#issuecomment-469168842
 
 
   @sijie I don't quite follow.  If a class has a field "Integer" than the field shoulda allow
vs if the field is "int" then it shouldn't:
   
   ```
    public static class Foo {
           int field1;
           Integer field2;
       }
   
           log.info("{}", new String(AvroSchema.of(Foo.class).getSchemaInfo().getSchema()));
   
   ```
   
   produces:
   
   ```
   {"type":"record","name":"Foo","namespace":"org.company.Test4$","fields":[{"name":"field1","type":"int"},{"name":"field2","type":["null","int"],"default":null}]}
   
   ```
   
   which is correct.  Am I missing something?
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message