It adds a File class (a subclass of FileStorage) which can be used for type hints, either by itself or as list[File]
validate_request() awaits request.files and puts the FileStorage objects into the appropriate data field. If we're expecting a list of files, we call MultiDict.getlist() to get all the files that were provided.
_build_path() recognizes the presence of File and list[File] in the schema, and changes the encoding to multipart/form-data
Also modified the documentation to explain how to use this
This is a PR to solve #37
It adds a
File
class (a subclass ofFileStorage
) which can be used for type hints, either by itself or aslist[File]
validate_request()
awaitsrequest.files
and puts theFileStorage
objects into the appropriatedata
field. If we're expecting a list of files, we callMultiDict.getlist()
to get all the files that were provided._build_path()
recognizes the presence ofFile
andlist[File]
in the schema, and changes the encoding tomultipart/form-data
Also modified the documentation to explain how to use this