3 ms·
The difference is really that with something like protobuf type safety is built in & with JSON it's an afterthought. With JSON Schema or OpenAPI it's on you to
by jrsj 3y ago
The difference is really that with something like protobuf type safety is built in & with JSON it's an afterthought. With JSON Schema or OpenAPI it's on you to keep things in sync with your API & there's often a significant amount of work that comes along with that too.
There's many tradeoffs of course, it's not like dealing with proto files is painless either.
- rswail 3y agoWhat you're actually saying is that when you use the standard language bindings for a protobuf parser, the type safety is as built in as your language. JSON has a limited set of types. There is object, array, string, number, boolean, and null. That's it. JSON Schema adds to that by providing definitions of types that build on those basic JSON types.