mirror of
https://github.com/LukeHagar/connexion.git
synced 2025-12-09 20:37:46 +00:00
Create AbstractRequestBodyValidator class
This commit is contained in:
@@ -28,8 +28,9 @@ def test_validator_map(json_validation_spec_dir, spec):
|
||||
MinLengthRequestValidator = extend(Draft4RequestValidator, {"type": validate_type})
|
||||
|
||||
class MyJSONBodyValidator(JSONRequestBodyValidator):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, validator=MinLengthRequestValidator, **kwargs)
|
||||
@property
|
||||
def _validator(self):
|
||||
return MinLengthRequestValidator(self._schema)
|
||||
|
||||
validator_map = {"body": {"application/json": MyJSONBodyValidator}}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user