What does HackerNews think of protoc-gen-validate?

protoc plugin to generate polyglot message validators

Language: Go

Ah, got it. Well as far as I know, proto2 (with required) isn't going anywhere and Any can still be used with it. One nice thing about protobuf is its extensibility, so you can still get required fields with something like protoc-gen-validate, but interpret them closer to the app's logic.

https://github.com/envoyproxy/protoc-gen-validate

You can make use of features like annotations to magic away the validation of APIs [0].

> people that can’t hand-serialize a struct

If you have 1 device type and 1 software version then this might work. If you have multiple CPU architectures and multiple versions of your software this will likely not work.

[0] - https://github.com/envoyproxy/protoc-gen-validate

You can add whatever custom validation you want on top of proto3 (using annotations if you like). Required fields aren't very useful at a serialization level: adding a new required field would always be a backwards incompatible change. You should never do it. They're only useful if you have total certainty that you can define all your APIs perfectly on the first try. But again, if you really want them you can always build something like https://github.com/envoyproxy/protoc-gen-validate on top. That's the benefit of a simple and extensible system vs one that tries to bake-in unnecessary or problematic default behaviors.

Also: why wouldn't grpc work well with load balancers? It's based on HTTP/2. It's well supported by envoy, which is fast-becoming the de facto standard proxy for service meshes.