GREsau / GREsau/okapi

Question: request_body concretization

Open
#154 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
740
Forks
127
PR merge metrics
No merged PRs in 30d

Description

Hi there. Is there any way i can tell openapi to take concrete type?
For example, i created this route and when documentation generated, request body type of **data** argument is **application/octet-stream** (because its Data type, i know) and then all example requests have 'Content-Type: application/octet-stream'. But how to explain it to OpenApi?

By the way, im a bit new in Rust, maybe i have missed something?

UPD: For more info, i saw something similar in utoipa, but i dont prefer this crate.
```rust
#[openapi(tag = "Uploader", ignore = "content_type")]
#[post("/upload", format = "multipart/form-data", data = "")]
async fn test_uploader(data: rocket::Data<'_>, content_type: &ContentType) -> (Status, Value) {
...
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.