1

I get the following error when I try to map the below json response using jackson:

Illegal character ((CTRL-CHAR, code 31)):
only regular white space (\r, \n,\t) is allowed between tokens   

I there any way I can filter out any malformed json before mapping?

node = new ObjectMapper().readTree(new URL(uri.toString())); <<<<< THROWS THE ERROR
{
    meta: {
        indexAllowed: false
    },
    products: {
        products: [ 
            {
                id: 1,
                name: "Apple iPhone 6 16GB 4G LTE GSM Factory Unlocked"
            },
            {
                id: 2,
                name: "Apple iPhone 7 8GB 4G LTE GSM Factory Unlocked"
            }
        ]
    }
}
rogger2016
  • 821
  • 3
  • 11
  • 28

0 Answers0