You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
Wondering if it's possible to update so that you treat all fields as required, unless it's explicitly has optional in the proto? Currently, if you set the flag all_fields_required, it will treat even fields which are marked as optional explicitly as required,.
The text was updated successfully, but these errors were encountered:
Alright, one thing to mention is that this would only ever apply to Proto2 (as with Proto3 we have to assume the defaults, being every field is optional).
I believe this logic can apply to Proto3 as well. By applying the flag "all_fields_required", we're overwriting the default proto3 behaviour. This enhancement allows for more fine grained control to define which fields to treat as required. Alternative could be a new flag - all_non_optional_fields_required?
FWIW I would find very useful to be able to mark as required only the "non-optional" fields. On proto3 they have re-added optional too, and the rationale is a bit complex to follow, but it's available here.
In our project we are basically following what they call Explicit presence discipline but at the end we try to use the .proto files also to build our datamodel schema, and we assume that if a field does not have the "optional" keyword should be treated as required.
Wondering if it's possible to update so that you treat all fields as required, unless it's explicitly has optional in the proto? Currently, if you set the flag all_fields_required, it will treat even fields which are marked as optional explicitly as required,.
The text was updated successfully, but these errors were encountered: