Derive Macro poem_openapi::Schema[][src]

#[derive(Schema)]
{
    // Attributes available to this derive:
    #[oai]
}
Expand description

Define a OpenAPI schema

Macro parameters

AttributedescriptionTypeOptional
nameObject namestringY
rename_fieldsRename all the fields according to the given case convention. The possible values are “lowercase”, “UPPERCASE”, “PascalCase”, “camelCase”, “snake_case”, “SCREAMING_SNAKE_CASE”.stringY
concretesSpecify how the concrete type of the generic Schema should be implemented.ConcreteTypeY
deprecationSchema deprecatedboolY

Field parameters

AttributedescriptionTypeOptional
skipSkip this fieldboolY
nameField namestringY

Examples

use poem_openapi::Schema;
 
/// Pet
#[derive(Schema)]
struct Pet {
    /// The id of this pet.
    id: String,
 
    /// The name of this pet.
    name: String,
}