#[derive(ApiCookie)]
{
// Attributes available to this derive:
#[openapi_cookie]
}
Expand description
Generates a reusable OpenAPI parameter schema in cookie.
This #[derive]
macro should be used in combination with api_operation.
The macro requires one and only one openapi_cookie
.
This macro requires your type to derive JsonSchema.
use apistos::ApiCookie;
use schemars::JsonSchema;
#[derive(Debug, Clone, JsonSchema, ApiCookie)]
#[openapi_cookie(
name = "X-Organization-Slug",
description = "Organization of the current caller",
required = true
)]
pub struct OrganizationSlugCookie(String);
§#[openapi_cookie(...)]
options:
name = "..."
a required parameter with the header namedescription = "..."
an optional description for the headerrequired = false
an optional parameter, default value is falsedeprecated = false
an optional parameter, default value is false
Because this macro requires JsonSchema, all attributes supported by JsonSchema are forwarded to this implementation.