Skip to content
TORNLIFE More

Mock API

Started by Peste84 [2297671] on in API Development.

4 replies · 214 views · thread synced · 4 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
4
Likes on archived posts
6
Authority score
52 / 100
Historical score
26 / 100
Story score
32 / 100
Engagement score
51 / 100
Peste84 [2297671]
Hello,

It would be nice if Torn offers a static test/mock API. I imagine having one valid and multiple invalid mock keys available.
Each invalid key should map to one of the possible torn errors. Some additional keys could even return different HTTP status codes.

My reasoning is that I am building an API and I plan to open source it. I would like to include some end-to-end tests and be notified (through my CI system) of any breaking change in the torn API.

What do you guys think?

kind regards,
Peste
SVD_NL [2363978]
It's a great idea, but it could be solved more easily: simply proper documentation.
The torn API really lacks in that aspect, and having the return values written out would be easy enough IMO
Prokrist [585251]
A good HTTP implementation would solve a lot issues. The api does not even send back proper HTTP codes...

What Language are you planning on using ?
Nexus [105937]
This guy has many good points.

Also using JSON arrays instead of "named nodes", like in the "icons", would be fantastic.

Spring (for example) makes it slightly more awkward to deserialize sometimes, the implementation would be much easier if we could just parse arrays of objects.