qemu/tests/qapi-schema/union-invalid-union-subtype.json
Daniel P. Berrangé a17dbc4b79 qapi: allow unions to contain further unions
This extends the QAPI schema validation to permit unions inside unions,
provided the checks for clashing fields pass.

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230420102619.348173-4-berrange@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2023-04-26 07:52:45 +02:00

30 lines
741 B
JSON

# Clash between common member and union variant's common member
# Base's member 'type' clashes with TestTypeA's
{ 'enum': 'TestEnum',
'data': [ 'value-a', 'value-b' ] }
{ 'enum': 'TestEnumA',
'data': [ 'value-a1', 'value-a2' ] }
{ 'struct': 'TestTypeA1',
'data': { 'integer': 'int' } }
{ 'struct': 'TestTypeA2',
'data': { 'integer': 'int' } }
{ 'union': 'TestTypeA',
'base': { 'type': 'TestEnumA' },
'discriminator': 'type',
'data': { 'value-a1': 'TestTypeA1',
'value-a2': 'TestTypeA2' } }
{ 'struct': 'TestTypeB',
'data': { 'integer': 'int' } }
{ 'union': 'TestUnion',
'base': { 'type': 'TestEnum' },
'discriminator': 'type',
'data': { 'value-a': 'TestTypeA',
'value-b': 'TestTypeB' } }