[Go] Perform empty string check on string fields when packing objects#7719
Merged
dbaileychess merged 2 commits intogoogle:masterfrom Dec 22, 2022
Merged
[Go] Perform empty string check on string fields when packing objects#7719dbaileychess merged 2 commits intogoogle:masterfrom
dbaileychess merged 2 commits intogoogle:masterfrom
Conversation
dbaileychess
approved these changes
Dec 22, 2022
sunwen18
pushed a commit
to sunwen18/flatbuffers
that referenced
this pull request
Dec 25, 2022
Co-authored-by: Derek Bailey <[email protected]>
razvanalex
added a commit
to razvanalex/flatbuffers
that referenced
this pull request
Sep 23, 2024
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 flatbuffers/google#7719 when the string field is required.
razvanalex
added a commit
to razvanalex/flatbuffers
that referenced
this pull request
Sep 24, 2024
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.
jochenparm
pushed a commit
to jochenparm/flatbuffers
that referenced
this pull request
Oct 29, 2024
Co-authored-by: Derek Bailey <[email protected]>
jochenparm
pushed a commit
to jochenparm/flatbuffers
that referenced
this pull request
Oct 29, 2024
Co-authored-by: Derek Bailey <[email protected]>
razvanalex
added a commit
to razvanalex/flatbuffers
that referenced
this pull request
Dec 3, 2024
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.
jtdavis777
pushed a commit
that referenced
this pull request
Dec 1, 2025
…PI (#8402) * [Go] Write required string fields into the buffer when using Object API 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 #7719 when the string field is required. * Add test for serializing required string fields using Object API * Update generated code The Monster schema contains a key string field. For historical convenience reasons, string keys are assumed required.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7709