You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When reading json file and converting to POJO array in first pojo is null. Data is present in json file. No exception is thrown for json file or for pojo conversion. Attached is the json and pojo files used. Not sure why exception is not thrown. The class that is null is EventParameters.
How I use Moshi is listed below: Inside the Quakeml is the class that contains an array of Events named EventParameters it is null after using the Moshi adaptor class to get quakeml object.
Quakeml quakeml=null;
Moshi moshi = new Moshi.Builder().build();
JsonAdapter jsonAdapter = moshi.adapter(Quakeml.class);
try {
quakeml = jsonAdapter.fromJson(content);
}catch (java.io.IOException ex){
System.out.println("debug MarsquakeCloudService.execute() ex:" + ex.getMessage());
}
I am using 1.13.0 of Moshi. I am using android studio.
I have attached the zip containing the files used
Thanks for help on this! I am doing this for school teachers (and to show what Moshi does to NASA) and hope to get this resolved.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When reading json file and converting to POJO array in first pojo is null. Data is present in json file. No exception is thrown for json file or for pojo conversion. Attached is the json and pojo files used. Not sure why exception is not thrown. The class that is null is EventParameters.
How I use Moshi is listed below: Inside the Quakeml is the class that contains an array of Events named EventParameters it is null after using the Moshi adaptor class to get quakeml object.
Quakeml quakeml=null;
Moshi moshi = new Moshi.Builder().build();
JsonAdapter jsonAdapter = moshi.adapter(Quakeml.class);
try {
quakeml = jsonAdapter.fromJson(content);
}catch (java.io.IOException ex){
System.out.println("debug MarsquakeCloudService.execute() ex:" + ex.getMessage());
}
I am using 1.13.0 of Moshi. I am using android studio.
I have attached the zip containing the files used
Thanks for help on this! I am doing this for school teachers (and to show what Moshi does to NASA) and hope to get this resolved.
Beta Was this translation helpful? Give feedback.
All reactions