I am trying to add a handler which handles upload of csv file via multipart
, but it doesnt work, please help
#1149
-
I was following the example, and added this code:
But the swagger doesnt offer me to upload file, it just treats I would expect to have similar openapi (from here https://swagger.io/docs/specification/v3_0/describing-request-body/multipart-requests/)
But I dont know how to express this, please help Ideally, I'd like to have a Form struct which has file field in it (with content of upload file), but I am totally OK to handle Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
If you want to define the schema according to OpenAPI 3.0, you can override the type with #[derive(ToSchema)]
struct EmailUpload {
#[schema(content_media_type = "application/octet-stream", value_type = String, format = Binary)]
email: Vec<u8>,
} |
Beta Was this translation helpful? Give feedback.
If you want to define the schema according to OpenAPI 3.0, you can override the type with
value_type
and then defineformat
which should correlate to the OpenAPI formats.