Crate elif_openapi

Crate elif_openapi 

Source
Expand description

§elif-openapi

OpenAPI 3.0 specification generation for elif.rs framework.

This crate provides automatic API documentation generation from annotated Rust code, with support for interactive Swagger UI and multiple export formats.

§Features

  • Automatic OpenAPI 3.0 specification generation
  • Route and endpoint discovery from framework types
  • Request/response schema extraction from Rust structs
  • Authentication scheme documentation
  • Interactive Swagger UI integration
  • Multiple export formats (Postman, Insomnia)

§Usage

use elif_openapi::{OpenApiGenerator, OpenApiConfig};

let mut generator = OpenApiGenerator::new(OpenApiConfig::default());
let routes = vec![]; // Your route metadata here
let spec = generator.generate(&routes).unwrap();

Re-exports§

pub use crate::config::OpenApiConfig;
pub use crate::error::OpenApiError;
pub use crate::error::OpenApiResult;
pub use crate::generator::OpenApiGenerator;
pub use crate::macros::OpenApiSchema;
pub use crate::schema::SchemaGenerator;
pub use crate::schema::TypeSchema;
pub use crate::specification::OpenApiSpec;
pub use crate::swagger::SwaggerUi;

Modules§

config
discovery
Project discovery and introspection for OpenAPI generation.
endpoints
Endpoint discovery and analysis for OpenAPI generation.
error
export
Export functionality for OpenAPI specifications.
generator
macros
OpenAPI schema generation traits and utilities.
schema
specification
swagger
Swagger UI integration for interactive API documentation.
utils
Utility functions for OpenAPI generation.

Derive Macros§

OpenApiSchema
Derive macro to automatically implement OpenApiSchema for structs and enums