-
-
Notifications
You must be signed in to change notification settings - Fork 133
[Bug]: Unable to send files through multipart/form in Flask when integrated with Openapi-Core #630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi, I've observed the same problem. It seems that the error is caused in I am not sure if I am just using it wrong but with plain Python
which is not parsed correctly and raises the exception, instead of
what would be parsed correctly. I don't know what's the appropriate way to fix this, unless I am using it wrong the parsing would need to have access to the header information describing the Otherwise the library works flawlessly, nice project! |
This should work now |
I am getting a similar issue on 0.18.2. Mine is a RequestBodyValidationError. It's thrown by a MediaTypeDeserializeError further up. Here are the relevant parts of the stacktrace:
I have basically the same endpoint structure as the example above, and I'm using the same curl request. |
Actual Behavior
Hello,
I am trying to Implement an API,
The API Takes a file as input in a REST API using multipart/form
I am using Flask to implement the REST API and following is the flask script
and following is the file_reader.yaml file
However when I hit the API I get following validation error
Expected Behavior
It is expected that there should be no validation errors as we have specified mime type as multipart/form.
Also as per OpenAPI docs, OpenAPI 3.0 does not support
type:file
field,and as per docs, while taking input we should specify
type:string
andformat:binary
so just wanted to confirm whether the request body is correct or not
Steps to Reproduce
Write the provided python3 file as
file_reader.py
and provided yaml file asfile_reader.yaml
Execute file_reader.py file
and use following CURL command to make a request
OpenAPI Core Version
0.17.1
OpenAPI Core Integration
Flask
Affected Area(s)
Deserializing
References
No response
Anything else we need to know?
No response
Would you like to implement a fix?
Yes
The text was updated successfully, but these errors were encountered: