I have a json String as follows.
"requestParams": [
"SupplierId": 15357,
"displayGsId": 5,
"supplierName": "SUPPLIER1",
"displayRequestId": 1
]
I am trying to parse it using Jackson 2. I know that it is an array and it maps to java.util.List in Java but, what about the elements in it. which object does it match to in java and how should i retrieve all those elements in array. Does each element maps to HashMap?
1 Answer 1
Correct the input, so it becomes valid JSON
{
"requestParams": [
{
"zycusSupplierId": 15357,
"displayGsId": 5,
"supplierName": "MONASH_SUPPLIER1",
"displayRequestId": 1
}
]
}
answered Oct 26, 2015 at 10:25
Verhagen
4,11429 silver badges41 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-java
{}then you'll have an object with a single array fieldrequestParams. If you lose therequestParamslabel you'll have an array. As it stands, it's not valid.