Replies: 2 comments 2 replies
-
This is definitely a bug - actually two bugs - thank you for reporting this. Just yesterday evening I published version 1.2.1 with several new features, I will add these two problems to the issues list. |
Beta Was this translation helpful? Give feedback.
2 replies
-
I am having an issue where the FromFiles field is a text field in the OpenAPI spec. Could an example be added to the OpenAPI section of the documentation for handling file uploads? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Not sure if this is a bug report of feature request.
I would like to deserialize and document (in OpenAPI) a multipart request. The docs have an example, but it is not clear if the example is for an
application/x-www-form-urlencoded
request or amultipart/form-data
request. From my testing (usingrequests
, both content types / formats are accepted).Additionally, the example gives me the following
openapi.yaml
:(side note, the spec requires that there always be at least 1 response documented)
The issue is that the
content
section incorrectly saysapplication/json
; I think it should bemultipart/form-data
orapplication/x-www-form-urlencoded
.If I replace
SomethingInput
with a Pydantic model, it at lest produces the right schema:In this case all that would be missing for basic support is that the content type be fixed.
But for more advanced use cases, it would be nice to get:
For what it's worth, the way I handled this in my toy web framework project is to make the parameter to
FromForm
be required to be a Pydantic model and each field in the model represents a field in the multipart request. So something like:Beta Was this translation helpful? Give feedback.
All reactions