If your schema is in JSON . We can use a different library to convert Json formatting. I used the GSON library to parse json data
Avro uses the JSON format to declare data structures.
Avro schemas are defined using JSON, which simplifies its implementation in languages ββwith JSON libraries.
So you can try this library built into jackson
app gradle dependency
compile 'com.google.code.gson:gson:2.7'
Convert strings to object
Gson gson = new Gson(); GsonParse gsonObj = gson.fromJson(jsonString);
Convert objects to strings
Gson gson = new Gson(); String puchaseDetails = gson.toJson(purchase);
You can also check it here if you use a library to parse and store data.
Amjad khan
source share