Get request form data or body and validate it against a schema.
(schema)
| 47 | |
| 48 | |
| 49 | def parse_request(schema): |
| 50 | """Get request form data or body and validate it against a schema.""" |
| 51 | if request.is_json: |
| 52 | data = request.get_json() |
| 53 | else: |
| 54 | data = request.form.to_dict(flat=True) |
| 55 | return validate(data, schema) |
| 56 | |
| 57 | |
| 58 | def validate(data, schema): |
no test coverage detected