3 ms·
So why use JSON for input if you don't need it? Because next morning you start to need it and your API becomes inconsistent and your b2b buddies make a deep si
by wruza 4y ago
So why use JSON for input if you don't need it?
Because next morning you start to need it and your API becomes inconsistent and your b2b buddies make a deep sigh which you can hear through a chat. Inconsistency is a minefield. Makes no sense to complicate everyones job out of the blue.
- crazygringo 4y agoOverengineering is a slippery slope. And the reality is that in 99% of cases, you don't need it. If there's a single data value that needs a flexible JSON payload, then just put that as an encoded string in your GET/POST parameter. It's not "inconsistency", it's just a special case. Same as you might not need a floating point number anywhere except for one endpoint. Not a big deal. You don't need to migrate the entire call to JSON-RPC.
- rerdavies 4y agoHow do you return data?
- wruza 4y agoIn my opinion, overengineering is putting JSON into a URL or exposing data as a resource and putting a URL parameter to it in a URL only to avoid an actual request body, for some unclear reason. I believe all the described tactics come from a static html limitations territory where it makes sense to put continuation data in hrefs to avoid forms and javascript.