Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protobuf: enable protobuf standard required mechanism #2622

Closed

Conversation

howardjohn
Copy link
Contributor

See https://google.aip.dev/203. Currently, there is support for an option (cue.opt).required. This is fine, but requires importing the cue.proto, and exposes cue to the public facing API.

With this approach, the built-in field behavior mechanism can be used, which is the standard way to declare a required field in proto.

See https://google.aip.dev/203. Currently, there is support for an
option `(cue.opt).required`. This is fine, but requires importing the
`cue.proto`, and exposes cue to the public facing API.

With this approach, the built-in field behavior mechanism can be used,
which is the standard way to declare a required field in proto.

Signed-off-by: John Howard <[email protected]>
@mvdan
Copy link
Member

mvdan commented Nov 17, 2023

Apologies that we didn't respond here sooner. Is there a particular reason you closed this PR?

Personally this seems like a good change to incorporate, so if you want to re-open the PR I can import it to Gerrit and get it merged. I can always do that even if you don't reopen the PR, but ideally I'd like your permission to do so :)

@howardjohn
Copy link
Contributor Author

howardjohn commented Nov 17, 2023 via email

@mvdan
Copy link
Member

mvdan commented Nov 17, 2023

Thanks! Imported to Gerrit as https://review.gerrithub.io/c/cue-lang/cue/+/1172314.

cueckoo pushed a commit that referenced this pull request Nov 20, 2023
See https://google.aip.dev/203. Currently, there is support for the
option `(cue.opt).required`. This is fine, but requires importing the
`cue.proto`, and exposes cue to the public facing API.

With this approach, the existing field behavior mechanism can be used,
which is the standard way to declare a required field in proto, like:

    RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED];

Closes #2622 as merged as of commit 6974630.

Signed-off-by: John Howard <[email protected]>
Change-Id: Ia8079a8b148c9abe9b6fe26d090c86cb4489359a
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1172314
Unity-Result: CUE porcuepine <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
Reviewed-by: Paul Jolly <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants