Attribute Macro rocket_okapi_fork::openapi [−][src]
#[openapi]
Expand description
A proc macro to be used in tandem with one of Rocket
’s endpoint macros. It requires that all
of the arguments of the route implement one of the traits in rocket_okapi::request
, and that
the return type implements OpenApiResponder
.
Example
ⓘ
use rocket_okapi::openapi; use rocket::get; #[openapi] #[get("/hello/<number>")] fn hello_world(number: i32) -> String { format!("Hellow world number {}", number) }