HI guys , I need to convert data received from API-REST to Avro GenericRecord. The schema is defined from the outside I do not want to use POJO java I do not want to create schema on the fly either because I want to be able to control the type before the base injection
I try all cases with the default / union values nothing works Example with : public static String JSON_SAMPLE_INT_ONLY = "{\n" + " \"myInt\": 12345\n" + "}"; with this : { "name": "test", "type": "record", "namespace": "hello.test", "fields": [ { "name": "myInt", "type": "int", "default": 0 }, { "name": "myString", "type": "string", "default": "" } ] } *i got Expected string. Got END_OBJECT* { "name": "test", "type": "record", "namespace": "hello.test", "fields": [ { "name": "myInt", "type": "int", "default": 0 }, { "name": "myString", "type": [ "null", "string" ], "default": null } ] } *i got Expected start-union. Got END_OBJECT* *any suggestion ? * *thanks *