I have a request JSON that other system has given to use. It looks like below:
{
\"list\": [
{
\"m1\": \"tval\",
\"fill\": {
\"tool\": \"4535\"
},
\"respfield\": [
\"tid\",
\"tName\"
]
}
]
}
Note that it has back slash in front of every key and value. I am unable to parse it directly in https://jsonformatter.org/ with back slashes. When I remove the back slashes and format the JSON I get:
{
"list": [
{
"m1": "tval",
"fill": {
"tool": "4535"
},
"respfield": [
"tid",
"tName"
]
}
]
}
I used curl command to hit the service with back slash JSON -> returns a response and without back slash JSON- which returns error. My question is how can I use the JSON with back slash to generate an Apex request class that I can serialize. Should I be using the one without back slashes( but the service retruns error when used with curl command)? would JSON serialize and curl behave differently?