Closed maximeborges closed 10 months ago
Proposition for #137
Example of usage:
let settings = OpenApiSettings::default(); let custom_route_spec = (vec![], custom_spec()); mount_endpoints_and_merged_docs! { building_rocket, "/v1".to_owned(), settings, "/" => custom_route_spec, "/api" => api::get_routes_and_docs(), }; mod api { pub fn get_routes_and_docs(settings: &OpenApiSettings) -> (Vec<rocket::Route>, OpenApi) { get_nested_endpoints_and_docs! { "/posts" => post::get_routes_and_docs(settings), "/message" => message::get_routes_and_docs(settings), } } mod posts { pub fn get_routes_and_docs(settings: &OpenApiSettings) -> (Vec<rocket::Route>, OpenApi) { openapi_get_routes_spec![settings: create_post, get_post] } } mod messages { pub fn get_routes_and_docs(settings: &OpenApiSettings) -> (Vec<rocket::Route>, OpenApi) { openapi_get_routes_spec![settings: create_message, get_message] } } }
Oh nice, that was quick. Looks good from a quick scan. Will review and merge later.
Ping just in case you missed the notification for new commits here. No need to rush merging things ;)
Proposition for #137
Example of usage: