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
|`TypedMultipart<T>`| Request body (multipart/form-data) |
161
+
|`Form<T>`| Request body (application/x-www-form-urlencoded) |
162
+
|`TypedMultipart<T>`| Request body (multipart/form-data) — typed with schema |
163
+
|`Multipart`| Request body (multipart/form-data) — untyped, generic object |
163
164
|`TypedHeader<T>`| Header parameters |
164
165
|`State<T>`| Ignored (internal) |
165
166
166
167
### Multipart Form Data
167
168
169
+
#### Typed Multipart (Recommended)
170
+
168
171
Upload files using `TypedMultipart` from [`axum_typed_multipart`](https://crates.io/crates/axum_typed_multipart):
169
172
170
173
```rust
@@ -188,6 +191,26 @@ Vespera automatically generates `multipart/form-data` content type in OpenAPI, a
188
191
189
192
> **Note:**`axum` must be a direct dependency of your project (not just via vespera) because `TryFromMultipart` internally references `axum::extract::multipart::Multipart`.
190
193
194
+
#### Raw Multipart (Untyped)
195
+
196
+
For dynamic multipart handling where the fields aren't known at compile time, use axum's built-in `Multipart` extractor:
This generates a `multipart/form-data` request body with a generic `{ "type": "object" }` schema in OpenAPI, since the fields are not statically known.
0 commit comments