|
@@ -180,6 +180,18 @@ class Hapic(object):
|
180
|
180
|
error_http_code: HTTPStatus = HTTPStatus.INTERNAL_SERVER_ERROR,
|
181
|
181
|
default_http_code: HTTPStatus = HTTPStatus.OK,
|
182
|
182
|
) -> typing.Callable[[typing.Callable[..., typing.Any]], typing.Any]:
|
|
183
|
+ """
|
|
184
|
+ Decorate with a wrapper who check and serialize each items in output
|
|
185
|
+ stream.
|
|
186
|
+
|
|
187
|
+ :param item_schema: Schema of output stream items
|
|
188
|
+ :param processor: ProcessorInterface object to process with given
|
|
189
|
+ schema
|
|
190
|
+ :param context: Context to use here
|
|
191
|
+ :param error_http_code: http code in case of error
|
|
192
|
+ :param default_http_code: http code in case of success
|
|
193
|
+ :return: decorator
|
|
194
|
+ """
|
183
|
195
|
processor = processor or MarshmallowOutputProcessor()
|
184
|
196
|
processor.schema = item_schema
|
185
|
197
|
context = context or self._context_getter
|