ironic.api.validation.validators module¶
Internal implementation of request/response validating middleware.
- class ironic.api.validation.validators.FormatChecker(formats: Iterable[str] | None = None)[source]¶
Bases:
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(param_value, format)[source]¶
Check whether the param_value conforms to the given format.
- Parameters:
param_value – the param_value to check
format (str) – the format that param_value should conform to
- Type:
any primitive type (str, number, bool)
- Raises:
FormatError
if param_value does not conform to format
- class ironic.api.validation.validators.SchemaValidator(schema, is_body=True)[source]¶
Bases:
object
A validator class
This class is changed from Draft202012Validator to add format checkers for data formats that are common in the Ironic API as well as add better error messages.
- validator = None¶
- validator_org¶
alias of
Draft202012Validator