mirror of
https://github.com/LukeHagar/connexion.git
synced 2025-12-06 04:19:26 +00:00
Fix file upload for base64 encoded files (#1843)
Fixes #1825 Files can be encoded as bytes or base64 ([openapi docs](https://swagger.io/docs/specification/describing-request-body/file-upload/)), we were only handling bytes before.
This commit is contained in:
@@ -61,10 +61,10 @@ class FormDataValidator(AbstractRequestBodyValidator):
|
||||
value = data.getlist(key)
|
||||
|
||||
def is_file(schema):
|
||||
return (
|
||||
schema.get("type") == "string"
|
||||
and schema.get("format") == "binary"
|
||||
)
|
||||
return schema.get("type") == "string" and schema.get("format") in [
|
||||
"binary",
|
||||
"base64",
|
||||
]
|
||||
|
||||
# Single file upload
|
||||
if is_file(param_schema):
|
||||
|
||||
Reference in New Issue
Block a user