diff options
author | Casper <casperneo@uchicago.edu> | 2021-01-12 14:06:43 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-12 14:06:43 -0500 |
commit | 8573108bbef495f3dd13db8353f43b2e86d25950 (patch) | |
tree | ebb69f81cf59651aa0d03f9b28c1c40e5c2c358c /src | |
parent | 7abe612b59968f8f53626dc06a3ded601cf234dc (diff) | |
download | flatbuffers-8573108bbef495f3dd13db8353f43b2e86d25950.tar.gz flatbuffers-8573108bbef495f3dd13db8353f43b2e86d25950.tar.bz2 flatbuffers-8573108bbef495f3dd13db8353f43b2e86d25950.zip |
Unset FieldDef.optional if its key (#6402)
* Unset FieldDef.optional if its key
* removed StringKey table, just removed an extra "required, key"
* removed extra newline
Co-authored-by: Casper Neo <cneo@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/idl_parser.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/idl_parser.cpp b/src/idl_parser.cpp index 31d702fd..0b108534 100644 --- a/src/idl_parser.cpp +++ b/src/idl_parser.cpp @@ -906,6 +906,7 @@ CheckedError Parser::ParseField(StructDef &struct_def) { struct_def.has_key = true; if (!IsScalar(type.base_type)) { field->required = true; + field->optional = false; if (type.base_type != BASE_TYPE_STRING) return Error("'key' field must be string or scalar type"); } |