{
addMessage(element, "value %1$s is not valid for empty union", object.toString());
}
else
{
DataSchema memberSchema = memberTypes.get(0);
assert(_recursive);
validate(element, memberSchema, object);
}
}
else if (object instanceof DataMap)
{
// Pegasus mode
DataMap map = (DataMap) object;
if (map.size() != 1)
{
addMessage(element, "DataMap should have exactly one entry for a union type");
}
else
{
Map.Entry<String, Object> entry = map.entrySet().iterator().next();
String key = entry.getKey();
DataSchema memberSchema = schema.getType(key);
if (memberSchema == null)
{
addMessage(element, "\"%1$s\" is not a member type of union %2$s", key, schema);
}
else if (_recursive)