Skip to content

Conversation

@razvanalex
Copy link
Contributor

In C++, CreateX allows to write the default "" value of a required string, when the string is not explicitly set (i.e., here). Object API Pack method uses this implementation of CreateX.

However, in go, despite whether the field is optional or required, it is always checked against empty string allowing to create messages that fail to pass the verifier. This commit partially reverts #7719 when the string field is required. It also affects string fields marked as key, which are considered required (i.e., here).

In C++, CreateX allows to write the default "" value of a required
string, when the string is not explicitly set. Object API Pack method
uses this implementation of CreateX.

However, in go, despite whether the field is optional or required, it is
always checked against empty string allowing to create messages that
fail to pass the verifier. This commits partially reverts google#7719 when the
string field is required.
The Monster schema contains a key string field. For historical
convenience reasons, string keys are assumed required.
@github-actions github-actions bot added c++ codegen Involving generating code from schema golang labels Sep 24, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Apr 7, 2025

This pull request is stale because it has been open 6 months with no activity. Please comment or label not-stale, or this will be closed in 14 days.

@github-actions github-actions bot added the stale label Apr 7, 2025
@razvanalex
Copy link
Contributor Author

It is still relevant.

@github-actions github-actions bot removed the stale label Apr 9, 2025
@jtdavis777 jtdavis777 self-requested a review December 1, 2025 02:28
@jtdavis777 jtdavis777 merged commit 31ab0bf into google:master Dec 1, 2025
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ codegen Involving generating code from schema golang

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants