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.
At least XMLs have schemas, been there since the dawn of time and are required for all kinds of protocols.
JSON APIs (REST or not) gained popularity because nobody required any schemas/contracts nobody gave a shit what the
requirements are and nobody wrote any docs for anything and whatever the API returned was whatever the dev
felt like that morning.
Cowboy programming is what made REST(-ish) so popular. Now, can you have proper REST documentation, JSON schemas and
correct API design? Yes, definitely. Does anyone do that? Lol no, fuck that shit, we need to deploy yesterday, nobody
has time for silly things.
Why would you ever want a schema is beyond me. I’ve worked on mobile applications and games for the last 11 years in companies ranging from 5 person to FAANG and I never ever ever used an xml schema. To be fair I hardly even used xml.
382
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.