Skip to main content

get

Attribute Macro get 

Source
#[get]
Expand description

Shortcut for #[utoipa::path(get, path = "...")].

Auto-fills operation_id from the function name when omitted. The path string lives in exactly one place.

Supports tag = "..." for a single tag or tags("A", "B") for multiple tags. Tags control how operations are grouped in documentation UIs (Scalar, Swagger UI, Redoc) and code generators.

Additional key = value pairs are forwarded to utoipa::path verbatim, so any feature accepted by the upstream macro (request body, responses, security, params) works without modification.

ยงTags

use doxa::get;

// Single tag (forwarded to utoipa as-is):
#[get("/api/v1/models", tag = "Models")]
async fn list_models() -> &'static str { "[]" }

// Multiple tags (extracted and emitted as `tags = [...]`):
#[get("/api/v2/models", tags("Models", "Public API"))]
async fn list_models_public() -> &'static str { "[]" }