Skip to main content

generate

Function generate 

Source
pub fn generate(spec_path: &Path, config: &Config) -> Result<String>
Expand description

Generate Rust from a spec file according to configuration, returning the source.

Models are emitted when generate.models is set, or implicitly when the server or client is generated (so referenced types are in scope). The axum server interface is appended when generate.std-http-server is set. The blocking reqwest client is appended when generate.client is set. Models, per-operation types, and both generators are emitted flat at the crate root, so server and client can share one file.