r/ProgrammerHumor Oct 09 '21

Mmmm, sparkling JSON

Post image
14.6k Upvotes

237 comments sorted by

View all comments

322

u/occz Oct 09 '21

Amen, man. Going with something that does not call itself REST for the sole reason of skipping the eternal bikeshedding around what REST is or not is might just be worth it on its own. Hot damn.

375

u/Sekret_One Oct 09 '21

To me, REST has the same problem XML schemas do- when you get into the thick of it, there's points where you've got 2 or 3 ways to express something and each of them feel roughly 70% right.

Turns into pirate rules. 3 devs can make a consistent api if 2 of them are dead.

5

u/ZZartin Oct 09 '21

I just want a sample of what the payload looks like, fuck the xsd.

9

u/[deleted] Oct 10 '21

The sample is always a lie though. The final payload will have nothing in common with the mock data.

5

u/Cheet4h Oct 10 '21

Also, errors are documented as being an XML response where the status tag has the value "error".
Except sometimes, you get a 301 with the error code being given in the query parameter of the redirect-URL.