Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: request_body concretization #154

Open
Kimishu opened this issue Nov 15, 2024 · 0 comments
Open

Question: request_body concretization #154

Kimishu opened this issue Nov 15, 2024 · 0 comments

Comments

@Kimishu
Copy link

Kimishu commented Nov 15, 2024

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.

#[openapi(tag = "Uploader", ignore = "content_type")]
#[post("/upload", format = "multipart/form-data", data = "<data>")]
async fn test_uploader(data: rocket::Data<'_>, content_type: &ContentType) -> (Status, Value) {
    ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant