Follow json (it only has 1 error, it can have several errors):
{
"errors": [
{
"code": "XX-55",
"path": "customer.id",
"description": "Cliente não encontrado"
}
]
}
Another example of the return: (Multiple errors)
{
"errors": [
{
"code": "XD-011",
"path": "items[0].product",
"description": "Informe o nome do produto"
},
{
"path": "items[0].quantity",
"description": "must be between 1 and 999999"
},
{
"code": "BJ-009",
"path": "items[0].price",
"description": "Todos os valores devem ser maiores que zero"
}
]
}
How can I tell if the schema is from this format? Because the return code may come different from the code above json. What interests me is the json code above.
I'm using JsonConvert.DeserializeObject
to convert, but the schema may be different. How can I know the string has this format: errors, code, path and description?