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 mapping my JSON below "{ \"ApprovalStatus\": 3, \"ApproverName\": \"Hi\" }"
to my java object defined as below
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;
import lombok.Getter;
import lombok.Setter;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"ApprovalStatus",
"ApproverName"
})
@Getter
@Setter
public class ItineraryJsonIter {
@JsonProperty ("ApprovalStatus")
public Long approvalStatus;
@JsonProperty ("ApproverName")
public String approverName;
}
However because of the case difference in JSON and class-member it does not get mapped properly, any idea what needs to be done here?
I am using following in my build dependencies
//JSON-ITER Based Parsing
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.11.0'
// Required if generating JSR-303 annotations
compile 'javax.validation:validation-api:1.1.0.CR2'
// Required if generating Jackson 2 annotations
compile 'com.fasterxml.jackson.core:jackson-databind:2.11.0'
// Required if generating JodaTime data types
compile 'joda-time:joda-time:2.2'
compile group: 'com.jsoniter', name: 'jsoniter', version: '0.9.23'
//End JSON-ITER Based Parsing
The text was updated successfully, but these errors were encountered:
scso
changed the title
Using java-library to bind json to java-object with "case" differenec
Unable to data-bind when using java-library to bind json to java-object with "case" difference in json field and class fields
Jun 17, 2020
When mapping my JSON below
"{ \"ApprovalStatus\": 3, \"ApproverName\": \"Hi\" }"
to my java object defined as below
However because of the
case
difference in JSON and class-member it does not get mapped properly, any idea what needs to be done here?I am using following in my build dependencies
The text was updated successfully, but these errors were encountered: