After fixing an error with JSON decoder -Property not specified in JSON decoder, got one more error from JSON decoder-
From the error it is clear that the data in response from the api is not valid JSON, thus the decoder throws error.
I went through the tracked service instance and checked what exactly is received, and as can be seen in below snap - it was HTML and no JSON message.
And as the returned message starts with < , the decoder was not able to parse it as valid JSON message is like:
{
"company": "Maruti",
"name": "Swift",
"price": 800000
}
Note: The RestApi has not implemented the required functionality, only instance of webapi is provisioned in Azure - thus the HTML is returned.
Here, we can't do anything except get the functionality implemented in Rest Api and let it return valid message. This error can also be encountered in case you are using JSON decoder and you receive XML.
From the error it is clear that the data in response from the api is not valid JSON, thus the decoder throws error.
Why it happened
I went through the tracked service instance and checked what exactly is received, and as can be seen in below snap - it was HTML and no JSON message.
And as the returned message starts with < , the decoder was not able to parse it as valid JSON message is like:
{
"company": "Maruti",
"name": "Swift",
"price": 800000
}
Note: The RestApi has not implemented the required functionality, only instance of webapi is provisioned in Azure - thus the HTML is returned.
What to do
Here, we can't do anything except get the functionality implemented in Rest Api and let it return valid message. This error can also be encountered in case you are using JSON decoder and you receive XML.
If you have questions or suggestions, feel free to do in comments section below !!!
Do share if you find this helpful .......
Knowledge Sharing is Caring !!!!!!
I think you are getting a JSON object (an array of JSON message which is enclosed in []) as input, so JSON decoder will not support JSON array. You have to write a custom pipline component to convert it to a valid xml.
ReplyDeleteHi Srikanth,
ReplyDeleteHere I am getting HTML, so there was error.
Thanks for comment ... will check for JSON array too