api_handler

Attribute Macro api_handler 

Source
#[api_handler]
Expand description

API handler with auto OpenAPI generation

Generates OpenAPI 3.1 schema for the annotated function.

§Example

#[api_handler(path = "/users", method = "POST", description = "Create user")]
async fn create_user(req: CreateUserRequest) -> CreateUserResponse {
    // handler implementation
}

// Generated function:
// fn create_user_openapi_schema() -> String { /* JSON schema */ }