keystone.common.validation package
Submodules
keystone.common.validation.parameter_types module
Common parameter types for validating a request reference.
keystone.common.validation.validators module
Internal implementation of request body validating middleware.
-
class keystone.common.validation.validators.SchemaValidator(schema)[source]
Bases: object
Resource reference validator class.
-
validate(*args, **kwargs)[source]
-
validator_org
alias of Draft4Validator
Module contents
Request body validating middleware for OpenStack Identity resources.
-
keystone.common.validation.add_array_type(property_schema)[source]
Convert the parameter schema to be of type list.
Parameters: | property_schema (dict) – schema to add array type to |
Returns: | a new dict schema |
-
keystone.common.validation.nullable(property_schema)[source]
Clone a property schema into one that is nullable.
Parameters: | property_schema (dict) – schema to clone into a nullable schema |
Returns: | a new dict schema |
-
keystone.common.validation.validated(request_body_schema, resource_to_validate)[source]
Register a schema to validate a resource reference.
Registered schema will be used for validating a request body just before
API method execution.
Parameters: |
- request_body_schema – a schema to validate the resource reference
- resource_to_validate – the reference to validate
|
Raises: |
- keystone.exception.ValidationError – if resource_to_validate is
None. (see wrapper method below).
- TypeError – at decoration time when the expected resource to
validate isn’t found in the decorated method’s
signature
|