Expand description
§Bytedocs
Bytedocs is a Rust alternative to Swagger for API documentation generation. It automatically generates beautiful, interactive API documentation from your Rust web applications.
§Features
- Framework Support: Works with Axum, Warp, Actix-web, and more
- Beautiful UI: Clean, responsive interface with dark/light mode
- Authentication: Built-in auth with session management and IP banning
- AI Integration: Optional AI-powered chat for API exploration
- OpenAPI Compatible: Generates standard OpenAPI 3.0.3 specifications
- Fast: Built with Rust for maximum performance
§Quick Start
use bytedocs_rs::{Bytedocs, Config};
#[tokio::main]
async fn main() {
let config = Config::default();
let mut docs = Bytedocs::new(Some(config));
// Add your API routes
docs.add_route("GET", "/users", None, Some("List all users"), None, None, None, None);
docs.add_route("POST", "/users", None, Some("Create a new user"), None, None, None, None);
// Generate documentation
docs.generate().unwrap();
println!("Documentation generated!");
}Re-exports§
pub use core::Config;pub use core::AuthConfig;pub use core::UIConfig;pub use core::APIInfo;pub use core::Documentation;pub use core::APIDocs;pub use core::Endpoint;pub use core::Parameter;pub use core::RequestBody;pub use core::Response;pub use core::RouteInfo;pub use core::load_config_from_env;pub use core::validate_config;pub use core::ByteDocsError;pub use core::Result;pub use ai::AIConfig;pub use ai::AIFeatures;pub use ai::ChatRequest;pub use ai::ChatResponse;pub use ai::Client as AIClient;pub use parser::AxumParser;pub use parser::WarpParser;pub use parser::ActixWebParser;pub use parser::FrameworkParser;pub use parser::extract_path_params;pub use parser::generate_default_responses;
Modules§
- ai
- AI integration module for Bytedocs.
- core
- Core functionality for Bytedocs.
- parser
- Parser module for different web frameworks.
Macros§
Structs§
- Byte
Docs Builder - Builder pattern for creating
Bytedocsinstances with custom configuration. - Bytedocs
- Main entry point for Bytedocs API documentation generation.
Functions§
- actix_
docs - Creates a
Bytedocsinstance configured for Actix-web framework. - axum_
docs - Creates a
Bytedocsinstance configured for Axum framework. - warp_
docs - Creates a
Bytedocsinstance configured for Warp framework.