0

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?

2
  • 1
    What you have there is not valid JSON. Commented Oct 26, 2015 at 10:21
  • 1
    If you wrap the whole thing in {} then you'll have an object with a single array field requestParams. If you lose the requestParams label you'll have an array. As it stands, it's not valid. Commented Oct 26, 2015 at 10:24

1 Answer 1

2

Correct the input, so it becomes valid JSON

{
    "requestParams": [
        {
            "zycusSupplierId": 15357,
            "displayGsId": 5,
            "supplierName": "MONASH_SUPPLIER1",
            "displayRequestId": 1
        }
    ]
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.