openapiv3
openapiv3 copied to clipboard
Code examples please
Hi. I like your crate. Could you provide more code examples, please? For example, how to print all paths and methods (GET, POST ...) extracted from JSON file, please?
Currently to find which methods are implemented for an endpoint I use this code
for (path, path_item) in openapi.paths.iter() {
println!("{}", path);
if path_item.clone().into_item().unwrap().get.is_some() {
println!("GET method exists");
}
if path_item.clone().into_item().unwrap().put.is_some() {
println!("PUT method exists");
}
}
But I don't know if that is the best solution.