[][src]Attribute Macro rocket_okapi::openapi

#[openapi]

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

This example is not tested
use rocket_okapi::openapi;
use rocket::get;

#[openapi]
#[get("/hello/<number>")]
fn hello_world(number: i32) -> String {
    format!("Hellow world number {}", number)
}