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§
- 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.
- 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.
- Server
- Server information.
- Tag
- API tag.
Enums§
- Parameter
Location - Parameter location.
- Schema
- JSON Schema representation.
- Schema
Type - JSON Schema primitive types.
Traits§
- HasParam
Meta - Trait for types that provide parameter metadata.
- Json
Schema - Trait for types that can generate JSON Schema.