|
@@ -23,11 +23,11 @@ class RequestParameters(object):
|
23
|
23
|
class ProcessValidationError(object):
|
24
|
24
|
def __init__(
|
25
|
25
|
self,
|
26
|
|
- error_message: str,
|
27
|
|
- error_details: dict,
|
|
26
|
+ message: str,
|
|
27
|
+ details: dict,
|
28
|
28
|
) -> None:
|
29
|
|
- self.error_message = error_message
|
30
|
|
- self.error_details = error_details
|
|
29
|
+ self.message = message
|
|
30
|
+ self.details = details
|
31
|
31
|
|
32
|
32
|
|
33
|
33
|
class ProcessorInterface(object):
|
|
@@ -71,8 +71,8 @@ class MarshmallowOutputProcessor(OutputProcessor):
|
71
|
71
|
data = self.schema.dump(data).data
|
72
|
72
|
errors = self.schema.load(data).errors
|
73
|
73
|
return ProcessValidationError(
|
74
|
|
- error_message='Validation error of output data',
|
75
|
|
- error_details=errors,
|
|
74
|
+ message='Validation error of output data',
|
|
75
|
+ details=errors,
|
76
|
76
|
)
|
77
|
77
|
|
78
|
78
|
|
|
@@ -91,7 +91,7 @@ class MarshmallowInputProcessor(InputProcessor):
|
91
|
91
|
def get_validation_error(self, data: dict) -> ProcessValidationError:
|
92
|
92
|
marshmallow_errors = self.schema.load(data).errors
|
93
|
93
|
return ProcessValidationError(
|
94
|
|
- error_message='Validation error of input data',
|
95
|
|
- error_details=marshmallow_errors,
|
|
94
|
+ message='Validation error of input data',
|
|
95
|
+ details=marshmallow_errors,
|
96
|
96
|
)
|
97
|
97
|
|