components/policy/tools/schema_validator.py
def ValidateSchema(self, schema):
    """Checks if |schema| is a valid schema and only uses valid $ref links.

    See _ValidateSchemaInternal() for a detailed description of the schema
    validation. This method also checks if all used $ref links are known and
    valid.
    Args:
      schema (dict): The JSON schema.
    Returns:
      bool: Whether the schema is valid or not.
    """
    self.found_ref_ids.clear()
    self.num_errors = 0

    self._ValidateSchemaInternal(schema)

    unknown_ref_ids = self.found_ref_ids.difference(self.schemas_by_id.keys())
    for unknown_ref_id in unknown_ref_ids:
      if unknown_ref_id in self.invalid_ref_ids:
        self._Error("$ref to invalid schema '%s'." % unknown_ref_id)
      else:
        self._Error("Unknown $ref '%s'." % unknown_ref_id)

    return self.num_errors == 0
Checks if |schema| is a valid schema and only uses valid $ref links.

    See _ValidateSchemaInternal() for a detailed description of the schema
    validation. This method also checks if all used $ref links are known and
    valid.
    Args:
      schema (dict): The JSON schema.
    Returns:
      bool: Whether the schema is valid or not.
    
Checks if |schema| is a valid schema and only uses valid $ref links.
See _ValidateSchemaInternal() for a detailed description of the schema
validation. This method also checks if all used $ref links are known and
valid.
Checks if |schema| is a valid schema and only uses valid $ref links . See _ValidateSchemaInternal () for a detailed description of the schema validation . This method also checks if all used $ref links are known and valid .
def ValidateSchema(self, schema):
    self.found_ref_ids.clear()
    self.num_errors = 0
    self._ValidateSchemaInternal(schema)
    unknown_ref_ids = self.found_ref_ids.difference(self.schemas_by_id.keys())
    for unknown_ref_id in unknown_ref_ids:
      if unknown_ref_id in self.invalid_ref_ids:
        self._Error("$ref to invalid schema '%s'." % unknown_ref_id)
      else:
        self._Error("Unknown $ref '%s'." % unknown_ref_id)
    return self.num_errors == 0
def ValidateSchema ( self , schema ) : self . found_ref_ids . clear ( ) self . num_errors = 0 self . _ValidateSchemaInternal ( schema ) unknown_ref_ids = self . found_ref_ids . difference ( self . schemas_by_id . keys ( ) ) for unknown_ref_id in unknown_ref_ids : if unknown_ref_id in self . invalid_ref_ids : self . _Error ( "$ref to invalid schema '%s'." % unknown_ref_id ) else : self . _Error ( "Unknown $ref '%s'." % unknown_ref_id ) return self . num_errors == 0
Checks if |schema| is a valid schema and only uses valid $ref links.
Checks if |schema| is a valid schema and only uses valid $ref links .
"""Checks if |schema| is a valid schema and only uses valid $ref links.

    See _ValidateSchemaInternal() for a detailed description of the schema
    validation. This method also checks if all used $ref links are known and
    valid.
    Args:
      schema (dict): The JSON schema.
    Returns:
      bool: Whether the schema is valid or not.
    """
Whether the schema is valid or not.
Whether the schema is valid or not .
bool
self
schema
The JSON schema.
The JSON schema .