Back to Poem

Macro parameters

poem-openapi/src/docs/enum.md

2.0.02.1 KB
Original Source

Define an OpenAPI enum

Macro parameters

AttributeDescriptionTypeOptional
renameRename the enumstringY
rename_allRename all the items according to the given case convention. The possible values are "lowercase", "UPPERCASE", "PascalCase", "camelCase", "snake_case", "SCREAMING_SNAKE_CASE", "kebab-case", "SCREAMING-KEBAB-CASE".stringY
deprecatedSchema deprecatedboolY
external_docsSpecify a external resource for extended documentationstringY
remoteDerive a remote enumstringY

Item parameters

AttributeDescriptionTypeOptional
renameRename the itemstringY

Examples

rust
use poem_openapi::Enum;

#[derive(Enum)]
enum PetStatus {
    Available,
    Pending,
    Sold,
}