News for hackers. Stuff that matters.
Re:Better Than JSON by port11 on Monday December 01, 2025 @02:27PM (#46111900)
I think the strict schema of Protobuf might be one of the major improvements, as most APIs don't publish a JSON schema? I've always had to use ajv or superstruct to make sure payloads match a schema, Protobuf doesn't need that (supposedly).
Re:Better Than JSON by thayne on Tuesday December 02, 2025 @04:04AM (#46119165)
One limitation of protobuf 3 schemas, is they doen't allow required fields. That makes it easier to remove the field in a later version in a backwards compatible way, but sometimes fields really are required, and the message doesn't make any sense without them. Ideally, IMO, if the message is missing those fields, it would fail to parse successfully. But with protobuf, you instead get a default value, which could potentially cause subtle bugs.
Re:Better Than JSON by port11 on Wednesday December 03, 2025 @12:01PM (#46136932)
Okay, this is a definite issue, you're still stuck validating inputs/outputs.