Crates.io | aide-axum-typed-multipart |
lib.rs | aide-axum-typed-multipart |
version | 0.13.0 |
source | src |
created_at | 2024-03-06 14:29:20.8699 |
updated_at | 2024-03-06 14:29:20.8699 |
description | Type safe multipart/form-data handling for axum and aide |
homepage | |
repository | https://github.com/tamasfe/aide |
max_upload_size | |
id | 1164866 |
size | 9,453 |
Wrapper around axum_typed_multipart
to generate documentation for multipart requests.
use aide_axum_typed_multipart::{FieldData, TypedMultipart};
use axum::{body::Bytes, http::StatusCode};
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;
}