def _parse_oneof_validator(error):
 types = []
 for context in error.context:
  if (context.validator == u'oneOf'):
   (_, error_msg) = _parse_oneof_validator(context)
   return (path_string(context.path), error_msg)
  if (context.validator == u'required'):
   return (None, context.message)
  if (context.validator == u'additionalProperties'):
   invalid_config_key = parse_key_from_error_msg(context)
   return (None, u"contains unsupported option: '{}'".format(invalid_config_key))
  if context.path:
   return (path_string(context.path), u'contains {}, which is an invalid type, it should be {}'.format(json.dumps(context.instance), _parse_valid_types_from_validator(context.validator_value)))
  if (context.validator == u'uniqueItems'):
   return (None, u'contains non unique items, please remove duplicates from {}'.format(context.instance))
  if (context.validator == u'type'):
   types.append(context.validator_value)
 valid_types = _parse_valid_types_from_validator(types)
 return (None, u'contains an invalid type, it should be {}'.format(valid_types))

def _parse_oneof_validator ( error ) : types = [ ] for context in error . context : if ( context . validator == u'oneOf' ) : ( _ , error_msg ) = _parse_oneof_validator ( context ) return ( path_string ( context . path ) , error_msg ) if ( context . validator == u'required' ) : return ( None , context . message ) if ( context . validator == u'additionalProperties' ) : invalid_config_key = parse_key_from_error_msg ( context ) return ( None , u"contains unsupported option: '{}'" . format ( invalid_config_key ) ) if context . path : return ( path_string ( context . path ) , u'contains {}, which is an invalid type, it should be {}' . format ( json . dumps ( context . instance ) , _parse_valid_types_from_validator ( context . validator_value ) ) ) if ( context . validator == u'uniqueItems' ) : return ( None , u'contains non unique items, please remove duplicates from {}' . format ( context . instance ) ) if ( context . validator == u'type' ) : types . append ( context . validator_value ) valid_types = _parse_valid_types_from_validator ( types ) return ( None , u'contains an invalid type, it should be {}' . format ( valid_types ) )
oneof has multiple schemas .