virHashTablePtr schema)
{
virJSONValuePtr base;
+ virJSONValuePtr obj;
const char *metatype;
const char *querystr;
char modifier;
if (!c_isalpha(modifier))
querystr++;
- if (modifier == '+')
+ if (modifier == '+') {
baseName = virQEMUQAPISchemaObjectGetType("variants",
querystr,
"case", base);
- else
- baseName = virQEMUQAPISchemaObjectGetType("members",
- querystr,
- "name", base);
+ } else {
+ obj = virQEMUQAPISchemaObjectGet("members", querystr,
+ "name", base);
+
+ if (modifier == '*' &&
+ !virJSONValueObjectHasKey(obj, "default"))
+ return NULL;
+
+ baseName = virQEMUQAPISchemaTypeFromObject(obj);
+ }
if (!baseName)
return NULL;
* attribute: selects whether arguments or return type should be introspected
* ("arg-type" or "ret-type" for commands, "arg-type" for events)
* subattribute: specifies member name of object types
+ * *subattribute: same as above but must be optional (has a property named
+ * 'default' field in the schema)
* +variant_discriminator: In the case of unionized objects, select a
* specific case to introspect.
*