r/badcode • u/Lumpy-Criticism-2773 • Feb 18 '23
python Upwork.com official API docs. $1B a year in revenue but can't get docs reviewed.
382
Upvotes
r/badcode • u/Lumpy-Criticism-2773 • Feb 18 '23
107
u/bolle_ohne_klingel Feb 18 '23
Do you mean that "config" comes out of nowhere?
4
u/scooptyy Feb 19 '23
Upwork is the biggest POS service I’ve ever used. Unfortunately, it’s the only place I found contractors worth their salt.
78
u/Chefzor Feb 18 '23
I don't understand the comments, just because you can understand or explain why or how something got messed up does not mean it is not bad code.
It sounds like people justifying something that is just objectively wrong, not to mention that providing wrong API documentation is quite bad, it's literally meant to tell you how to consume it.
24
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Feb 18 '23
Image Transcription: Code
EXAMPLE REQUEST
I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
11
u/[deleted] Feb 18 '23
storing bool values as strings for the efficiency gainz
5
u/rimpy13 Feb 19 '23
What's upwork? Not much, what's up with you, work?
13
u/ssjskipp Feb 18 '23
Imagine being salty about docs that at least exist
1
u/toramanlis Feb 19 '23
it's probably because they're gonna be sent in a query string where everything is a string :) if you pass 0 it'll become "0" and gonna be evaluated as true for being a nonempty string. since the backend has to just look for a specific value in that string they must have figured it may as well be "false".
the real solution here is including payloads in GET requests to the standard. then it's gonna be a lot easier with parameters sent as json.
i know you can just add a payload to a GET request and can receive it at backend but that's assuming all the levels in between carry that payload. some service out there may just be like "this is a GET, i'll just pass an empty body" and u'll lose your shit
-2
u/NickSicilianu Feb 18 '23
lol 😂 they means params = { ‘onlyRoomsId’ : ‘false’ }; probably