Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.http.data_validator.RequestDataValidator Class Reference

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

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.

Member Function Documentation

◆ _HassViewT()

def homeassistant.components.http.data_validator.RequestDataValidator._HassViewT
private

Definition at line 40 of file data_validator.py.

◆ wrapper()

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.

Member Data Documentation

◆ _allow_empty

homeassistant.components.http.data_validator.RequestDataValidator._allow_empty
private

Definition at line 38 of file data_validator.py.

◆ _schema

homeassistant.components.http.data_validator.RequestDataValidator._schema
private

Definition at line 37 of file data_validator.py.


The documentation for this class was generated from the following file: