4 ms·
That’s an extra field, with no consistency validation, and does not play well with JSON. A field can be either "" or null, and that’s two different cases. Also
by tuetuopay 2y ago
That’s an extra field, with no consistency validation, and does not play well with JSON. A field can be either "" or null, and that’s two different cases.
Also the wrappers are known to most protobuf code generators, that can then use language features for better ergonomics. E.g. in Rust all wrappers to allow nullability of values will be turned in Option. Like the StringValue will turn into Option<String>.
As for the need, yes, it is needed. This carries intent, which is a good thing in customer facing APIs. An update endpoint will have all fields optional to distinguish between a field needing to be overridden or not, without the need to re-send the value when it does not need to be changed (à la PUT). Having additional boolean fields gets unwieldy quickly.