flexmeasures.api.common.utils.args_parsing

Functions

flexmeasures.api.common.utils.args_parsing.handle_error(error, req, schema, *, error_status_code, error_headers)

Replacing webargs’s error parser, so we can throw custom Exceptions.

flexmeasures.api.common.utils.args_parsing.load_data(request, schema)

We allow parameters to come from either GET args or POST JSON, as validators can be attached to either.

flexmeasures.api.common.utils.args_parsing.validation_error_handler(error: FMValidationError)

Handles errors during parsing. Aborts the current HTTP request and responds with a 422 error. FMValidationError attributes “result” and “status” are packaged in the response.