summaryrefslogtreecommitdiff
path: root/src/idl_parser.cpp
diff options
context:
space:
mode:
authorCasper <casperneo@uchicago.edu>2021-01-12 14:06:43 -0500
committerGitHub <noreply@github.com>2021-01-12 14:06:43 -0500
commit8573108bbef495f3dd13db8353f43b2e86d25950 (patch)
treeebb69f81cf59651aa0d03f9b28c1c40e5c2c358c /src/idl_parser.cpp
parent7abe612b59968f8f53626dc06a3ded601cf234dc (diff)
downloadflatbuffers-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/idl_parser.cpp')
-rw-r--r--src/idl_parser.cpp1
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");
}