aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/qapi/expr.py2
-rw-r--r--tests/qapi-schema/enum-dict-no-name.err2
-rw-r--r--tests/qapi-schema/enum-dict-no-name.json2
-rw-r--r--tests/qapi-schema/enum-dict-no-name.out0
4 files changed, 5 insertions, 1 deletions
diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py
index 496f7e0333..cf98923fa6 100644
--- a/scripts/qapi/expr.py
+++ b/scripts/qapi/expr.py
@@ -455,8 +455,8 @@ def check_enum(expr: _JSONObject, info: QAPISourceInfo) -> None:
for m in members]
for member in members:
source = "'data' member"
- member_name = member['name']
check_keys(member, info, source, ['name'], ['if'])
+ member_name = member['name']
check_name_is_str(member_name, info, source)
source = "%s '%s'" % (source, member_name)
# Enum members may start with a digit
diff --git a/tests/qapi-schema/enum-dict-no-name.err b/tests/qapi-schema/enum-dict-no-name.err
new file mode 100644
index 0000000000..3ce0c16987
--- /dev/null
+++ b/tests/qapi-schema/enum-dict-no-name.err
@@ -0,0 +1,2 @@
+enum-dict-no-name.json: In enum 'Enum':
+enum-dict-no-name.json:2: 'data' member misses key 'name'
diff --git a/tests/qapi-schema/enum-dict-no-name.json b/tests/qapi-schema/enum-dict-no-name.json
new file mode 100644
index 0000000000..5952a8662e
--- /dev/null
+++ b/tests/qapi-schema/enum-dict-no-name.json
@@ -0,0 +1,2 @@
+# enum member lacking a name
+{ 'enum': 'Enum', 'data': [ {} ] }
diff --git a/tests/qapi-schema/enum-dict-no-name.out b/tests/qapi-schema/enum-dict-no-name.out
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/qapi-schema/enum-dict-no-name.out