a17dbc4b79
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>
30 lines
741 B
JSON
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' } }
|