Skip to main content

Multipart

Attribute Macro Multipart 

Source
#[Multipart]
Expand description

#[Multipart(file("avatar"), text("alt"))] — declare that a handler consumes a multipart/form-data body, for the OpenAPI surface.

file(..) parts render as string/binary (a file picker in Swagger UI) and are marked required; text(..) parts render as string. The handler still reads the body with MultipartForm::from_ctx; this attribute is the documentation mirror. Marker attribute; consumed by #[Controller].