Version: 3.x


YamlValidationException Objects

class YamlValidationException(YamlException, ValueError)

Raised if a yaml file does not correspond to the expected schema.


def __init__(message: Text,
validation_errors: Optional[List[
SchemaError.SchemaErrorEntry]] = None,
filename: Optional[Text] = None,
content: Any = None) -> None

Create The Error.


  • message - error message
  • validation_errors - validation errors
  • filename - name of the file which was validated
  • content - yaml content loaded from the file (used for line information)


def validate_yaml_schema(yaml_file_content: Text,
schema_path: Text,
package_name: Text = PACKAGE_NAME) -> None

Validate yaml content.


  • yaml_file_content - the content of the yaml file to be validated
  • schema_path - the schema of the yaml file
  • package_name - the name of the package the schema is located in. defaults to rasa.


def validate_training_data(json_data: Dict[Text, Any],
schema: Dict[Text, Any]) -> None

Validate rasa training data format to ensure proper training.


  • json_data - the data to validate
  • schema - the schema


SchemaValidationError if validation fails.


def validate_training_data_format_version(yaml_file_content: Dict[Text, Any],
filename: Optional[Text]) -> bool

Validates version on the training data content using version field and warns users if the file is not compatible with the current version of Rasa Open Source.


  • yaml_file_content - Raw content of training data file as a dictionary.
  • filename - Name of the validated file.


True if the file can be processed by current version of Rasa Open Source, False otherwise.