Hi, I am playing with The Chart Of Accounts endpoint.
The data structure uses a superfluous “Nominal” Object in JSON, making the API inconsistent across the endpoints.
For illustration, here are three different response bodies for
- no nominals found (i.e. empty list returned from search query)
- one nominal found
- 2 or more nominals found.
No nominals found
"Body": {
"Nominals": null
}
One nominal found
"Body": {
"Nominals": {
"Nominal": {
"Code": "1251",
"SystemCode": "False",
"Amount": "****"
}
}
}
2 or more nominals found
"Body": {
"Nominals": {
"Nominal": [
{
"Code": "1201",
"SystemCode": "True",
"Amount": "****"
},
{
"Code": "1210",
"SystemCode": "False",
"Amount": "****"
}
]
}
}
These SHOULD BE like this, for consistency:
No nominals found
"Body": {
"Nominals": null
}
One nominal found
"Body": {
"Nominals": {
"Code": "1251",
"SystemCode": "False",
"Amount": "****"
}
}
2 or more nominals found
"Body": {
"Nominals": [
{
"Code": "1201",
"SystemCode": "True",
"Amount": "****"
},
{
"Code": "1210",
"SystemCode": "False",
"Amount": "****"
}
]
}