use super::super::bound::{self, Incoming};
use super::FromContent;
use ohkami_lib::serde_multipart;
pub use ohkami_lib::serde_multipart::File;
#[cfg(feature = "openapi")]
use crate::openapi;
pub struct Multipart<T: bound::Schema>(pub T);
impl<'req, T: Incoming<'req>> FromContent<'req> for Multipart<T> {
const MIME_TYPE: &'static str = "multipart/form-data";
fn from_content(body: &'req [u8]) -> Result<Self, impl std::fmt::Display> {
serde_multipart::from_bytes(body).map(Multipart)
}
#[cfg(feature = "openapi")]
fn openapi_requestbody() -> impl Into<openapi::schema::SchemaRef> {
T::schema()
}
}