You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to make an endpoint that receives a file in a multipart formdata, but when I try to put the type for the argument in the function I get the following error:
Error
the trait bound `rocket::fs::TempFile<'_>: rocket_okapi::JsonSchema` is not satisfied [E0277] the trait `rocket_okapi::JsonSchema` is not implemented for `rocket::fs::TempFile<'_>`, which is required by `rocket::form::Form<rocket::fs::TempFile<'_>>: rocket_okapi::request::OpenApiFromData<'_>` Help: the following other types implement trait `rocket_okapi::JsonSchema`: &'a T &'a mut T () (T0, T1) (T0, T1, T2) (T0, T1, T2, T3) (T0, T1, T2, T3, T4) (T0, T1, T2, T3, T4, T5) and 164 others Note: required for `rocket::form::Form<rocket::fs::TempFile<'_>>` to implement `rocket_okapi::request::OpenApiFromData<'_>`
Code
#[openapi(tag = "User")]#[patch("/change-profile-picture", data = "<file>")]pubasyncfnchange_profile_picture(conn:Connection<'_,Db>,jwt_guard:JwtGuard,file:Form<TempFile<'_>>,minio:&State<MinioStorage>,) -> Result<Status,Error>{// Rust code...}
rocket = { version = "0.5.1", features = ["serde_json", "secrets", "json"] }
schemars = { version = "0.8.21", features = ["uuid1", "impl_json_schema", "chrono", "derive_json_schema", "derive"] }
rocket_okapi = { version = "0.9.0", features = ["secrets", "rapidoc", "rocket_db_pools", "uuid"] }
The text was updated successfully, but these errors were encountered:
I am trying to make an endpoint that receives a file in a multipart formdata, but when I try to put the type for the argument in the function I get the following error:
The text was updated successfully, but these errors were encountered: