openapi-rust-sdk icon indicating copy to clipboard operation
openapi-rust-sdk copied to clipboard

Openapi SDK async methods in Clap subcommands

Open francescobianco opened this issue 1 year ago • 0 comments

I have CLI commands with Clap:

let matches = App::new("CLI").get_matches();
if let Some(_) = matches.subcommand_matches("fetch") {
    sdk.get_users().await.unwrap();
}

Compiling fails because async calls are not allowed in main. How can I structure async SDK calls in a synchronous Clap CLI?

francescobianco avatar Oct 01 '25 09:10 francescobianco