Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 688 Bytes

File metadata and controls

27 lines (22 loc) · 688 Bytes

aide-axum-typed-multipart

Wrapper around axum_typed_multipart to generate documentation for multipart requests.

Example

use aide_axum_typed_multipart::{FieldData, TypedMultipart};
use axum::{http::StatusCode};
use bytes::Bytes;
use axum_typed_multipart::TryFromMultipart;
use schemars::JsonSchema;

#[derive(TryFromMultipart, JsonSchema)]
struct MyMultipart {
    title: String,
    description: String,
    #[form_data(limit = "unlimited")]
    image: FieldData<Bytes>,
}

async fn post_hello_world(_: TypedMultipart<MyMultipart>) -> StatusCode {
    // do something
    return StatusCode::OK;
}