The nova.api.validation.validators Module

Internal implementation of request Body validating middleware.

class FormatChecker(formats=None)

Bases: jsonschema._format.FormatChecker

A FormatChecker can output the message from cause exception

We need understandable validation errors messages for users. When a custom checker has an exception, the FormatChecker will output a readable message provided by the checker.

check(instance, format)

Check whether the instance conforms to the given format.

Parameters:
  • instance – the instance to check
  • format (str) – the format that instance should conform to
Type:

any primitive type (str, number, bool)

Raises:

FormatError if instance does not conform to format

Previous topic

The nova.api.validation.parameter_types Module

Next topic

The nova.api.validator Module

Project Source

This Page