Skip to content
TORNLIFE More

[API] Empty OC list

Started by Kivou [2000607] on in Bugs & Issues.

4 replies · 69 views · thread synced · 3 days ago · View on torn.com
About this thread

Posts archived: 5 / 5 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
5
Discussion span
→
People posting
3
Likes on archived posts
1
Posts by staff, officers and moderators
3
Authority score
58 / 100
Historical score
30 / 100
Story score
33 / 100
Engagement score
41 / 100

Most-liked replies

Kivou [2000607]
Hey,

most of the time the OC output has the form of an object {} but when no OC are recorded the API returns and empty list [] (and not an empty object). That's a minor inconsistency but still, it leads to type related errors.

Thanks for considering.
Kivou [2000607]
Yes!
When the faction has achieved OC the API throws an objetc like that
"crimes": {
"9565351": {
"crime_id": 8,
"crime_name": "Political Assassination",
"participants": [
{

but when there are no crimes it throws a list

{
"crimes": []
}

where I would have expected an empty object
{
"crimes": {}
}