pub struct Cli {
pub spec_file: PathBuf,
pub config_file: PathBuf,
pub output_file: Option<PathBuf>,
pub check: bool,
pub install_deps: bool,
}Expand description
Generate Rust code from an OpenAPI 3 specification.
Fields§
§spec_file: PathBufPath to the OpenAPI 3 specification (YAML or JSON).
config_file: PathBufPath to an oapi-codegen YAML configuration file (required).
output_file: Option<PathBuf>Output file path (overrides configuration output:).
Required unless the configuration sets output:.
check: boolCompare the generated code with the output file, and write nothing.
The exit code is 0 when the output file holds the generated code. The exit code is 1 when the file differs, or when the file is absent. Use this in continuous integration to make stale output a failed build. This flag reports no dependencies, because it adds none.
install_deps: boolAfter the write, run cargo add for each required crate.
If set, this runs with no prompt.
If stdin is interactive and the flag is not set, the CLI asks first.
If stdin is not interactive and the flag is not set, the CLI prints only the list.
cargo add targets the package whose Cargo.toml is nearest output.
It merges with an existing declaration.
A crate that already exists is updated in place.
Trait Implementations§
Source§impl Args for Cli
impl Args for Cli
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl CommandFactory for Cli
impl CommandFactory for Cli
Source§impl FromArgMatches for Cli
impl FromArgMatches for Cli
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.