mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 20:15:34 +00:00
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>
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user