Given the following JSON
{ "obj" : { "f1" : "blah", "f2" : "blah", "f3" : [{"z1" : "blah", "arr" : [{"m1" : "blah", "m2" : "blah"}]}] } }
I'm tired of using @JsonProperty and @JsonCreator to display the values โโof "m1" and "m2" , but no luck.
With @JsonCreator public Card(Map<String,Object> props) { } I get the following error:
Argument #0 of constructor [constructor for MyObj$Obj$Card, annotations: {interface com.fasterxml.jackson.annotation.JsonCreator=@com.fasterxml.jack son.annotation.JsonCreator()}] has no property name annotation; must have name when multiple-paramater constructor annotated as Creator
With @JsonCreator public Card(@JsonProperty("m1") String m1, @JsonProperty("m2") String m2,){} I get the following error:
Argument #0 of constructor [constructor for MyObj$Obj$Card, annotations: {interface com.fasterxml.jackson.annotation.JsonCreator=@com.fasterxml.jack son.annotation.JsonCreator()}] has no property name annotation; must have name when multiple-paramater constructor annotated as Creator
How can "arr" fields be displayed using Jackson's annotation? Thanks.
UPDATE
I also tried to include @JsonProperty("arr") private Card[] cards; to class f3 , but that didn't help either.
UPDATE 2
I changed the type of the array in the above update, and now I am not getting an error, but it does not behave the way I want (I would like to process the display).
Is there any chance that the error can be explained in such a way that I can correct them.
Mroth source share