fastapi-openapi 0.2.0

OpenAPI 3.1 types and schema generation for fastapi_rust
Documentation

OpenAPI 3.1 types and schema generation.

This crate provides:

  • OpenAPI 3.1 document types
  • JSON Schema types
  • JsonSchema trait 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();