20 ms·
JSON sucks. Maybe half our REST bugs are directly related to JSON parsing. Is that a long or an int? Boolean or the string "true"? Does my library include unde
by nullwasamistake 7y ago
JSON sucks. Maybe half our REST bugs are directly related to JSON parsing.
Is that a long or an int? Boolean or the string "true"? Does my library include undefined properties in the JSON? How should I encode and decode this binary blob?
We tried using OpenApi specs on the server and generators to build the clients. In general, the generators are buggy as hell. We eventually gave up as about 1/4 of the endpoints generated directly from our server code didn't work. One look at a spec doc will tell you the complexity is just too high.
We are moving to gRPC. It just works, and takes all the fiddling out of HTTP. It saves us from dev slap fights over stupid cruft like whether an endpoint should be PUT or POST. And saves us a massive amount of time making all those decisions.
- hu3 7y agoOff-topic but I'd want to work on a place where half the REST bugs are from JSON parsing.
- nullwasamistake 7y agoJust get a boring webapp job in CRUD world :)
- craigds 7y agoYeah I don't believe I've ever seen a json parsing problem in 11 years of software development.
- chairmanwow 7y agoI have had the absolute joy of working with gRPC services recently. Static schemas and built in streaming mechanics are fantastic. It definitely removes a lot of my gripes with REST endpoints by design.