#[derive(Schema)]
{
// Attributes available to this derive:
#[oai]
}
Expand description
Define a OpenAPI schema
Attribute | description | Type | Optional |
name | Object name | string | Y |
rename_fields | Rename all the fields according to the given case convention. The possible values are “lowercase”, “UPPERCASE”, “PascalCase”, “camelCase”, “snake_case”, “SCREAMING_SNAKE_CASE”. | string | Y |
concretes | Specify how the concrete type of the generic Schema should be implemented. | ConcreteType | Y |
deprecation | Schema deprecated | bool | Y |
Attribute | description | Type | Optional |
skip | Skip this field | bool | Y |
name | Field name | string | Y |
use poem_openapi::Schema;
#[derive(Schema)]
struct Pet {
id: String,
name: String,
}