Expand description
OpenAPI 3.1 types and schema generation.
This crate provides:
- OpenAPI 3.1 document types
- JSON Schema types
JsonSchematrait for compile-time schema generation
§Example
ⓘ
use fastapi_openapi::{OpenApiBuilder, JsonSchema};
#[derive(JsonSchema)]
struct Item {
id: i64,
name: String,
}
let spec = OpenApiBuilder::new("My API", "1.0.0")
.route(&get_items_route())
.build();Structs§
- AnyOf
Schema - Inclusive union, used for nullable types whose inner schema may allow null.
- Array
Schema - Array schema.
- Components
- Reusable components.
- Enum
Schema - Enum schema with allowed values.
- Example
- Example object for OpenAPI.
- Info
- API information.
- Media
Type - Media type content.
- OAuth
Flows - OAuth2 flows supported by this model: the password flow only.
- OAuth
Password Flow - OpenAPI metadata for an OAuth2 password flow.
- Object
Schema - Object schema.
- OneOf
Schema - OneOf schema (union type).
- OpenApi
- OpenAPI 3.1 document.
- Open
ApiBuilder - OpenAPI document builder.
- Operation
- API operation.
- Param
Meta - Parameter metadata for OpenAPI documentation.
- Parameter
- Operation parameter.
- Path
Item - Path item (operations for a path).
- Primitive
Schema - Primitive type schema.
- RefSchema
- Schema reference.
- Request
Body - Request body.
- Response
- Response definition.
- Schema
Registry - Schema registry for
#/components/schemas. - Schema
Registry Mut - A mutable view into an existing component schema map.
- Security
Metadata - Registration-time extractor metadata; this is not a serialized OpenAPI object.
- Server
- Server information.
- Tag
- API tag.
Enums§
- ApiKey
Location - A location supported by an OpenAPI API key security scheme.
- Parameter
Location - Parameter location.
- Schema
- JSON Schema representation.
- Schema
Type - JSON Schema primitive types.
- Security
Scheme - Supported OpenAPI security scheme definitions.
Traits§
- HasParam
Meta - Trait for types that provide parameter metadata.
- Json
Schema - Trait for types that can generate JSON Schema.
Type Aliases§
- Security
Requirement - One security requirement object: all named schemes must be satisfied.