Public Member Functions | |
| None | __init__ (self, VolDictType|vol.Schema schema, bool allow_empty=False) |
| web.Response | wrapper (_HassViewT view, web.Request request, *_P.args args, **_P.kwargs kwargs) |
Private Member Functions | |
| def | _HassViewT |
Private Attributes | |
| _allow_empty | |
| _schema | |
Decorator that will validate the incoming data. Takes in a voluptuous schema and adds 'data' as keyword argument to the function call. Will return a 400 if no JSON provided or doesn't match schema.
Definition at line 21 of file data_validator.py.
| None homeassistant.components.http.data_validator.RequestDataValidator.__init__ | ( | self, | |
| VolDictType | vol.Schema | schema, | ||
| bool | allow_empty = False |
||
| ) |
Initialize the decorator.
Definition at line 30 of file data_validator.py.
|
private |
Definition at line 40 of file data_validator.py.
| web.Response homeassistant.components.http.data_validator.RequestDataValidator.wrapper | ( | _HassViewT | view, |
| web.Request | request, | ||
| *_P.args | args, | ||
| **_P.kwargs | kwargs | ||
| ) |
Wrap a request handler with data validation.
Definition at line 53 of file data_validator.py.
|
private |
Definition at line 38 of file data_validator.py.
|
private |
Definition at line 37 of file data_validator.py.