Expand description
Route extraction module for parsing web framework route definitions.
This module provides a unified interface for extracting route information from different web frameworks. Each framework has its own extractor implementation that knows how to parse framework-specific route definitions.
§Supported Frameworks
- Axum: See
axum::AxumExtractor - Actix-Web: See
actix::ActixExtractor
§Example
use openapi_from_source::extractor::{RouteExtractor, axum::AxumExtractor};
use openapi_from_source::parser::AstParser;
use std::path::Path;
let parsed = AstParser::parse_file(Path::new("src/main.rs")).unwrap();
let extractor = AxumExtractor;
let routes = extractor.extract_routes(&[parsed]);
println!("Found {} routes", routes.len());Modules§
Structs§
- Parameter
- Information about a single parameter in a route handler.
- Route
Info - Complete information about a single API endpoint.
- Type
Info - Type information extracted from Rust code for OpenAPI schema generation.
Enums§
- Http
Method - HTTP methods supported by route extractors.
- Parameter
Location - The location where a parameter value is extracted from in an HTTP request.
Traits§
- Route
Extractor - Trait for extracting route information from parsed Rust files.