Skip to main content

GeneratorConfig

Struct GeneratorConfig 

Source
pub struct GeneratorConfig {
Show 19 fields pub spec_path: PathBuf, pub output_dir: PathBuf, pub module_name: String, pub enable_sse_client: bool, pub enable_async_client: bool, pub enable_specta: bool, pub type_mappings: BTreeMap<String, String>, pub streaming_config: Option<StreamingConfig>, pub nullable_field_overrides: BTreeMap<String, bool>, pub extensible_enum_overrides: BTreeMap<String, bool>, pub schema_extensions: Vec<PathBuf>, pub http_client_config: Option<HttpClientConfig>, pub retry_config: Option<RetryConfig>, pub tracing_enabled: bool, pub auth_config: Option<AuthConfig>, pub enable_registry: bool, pub registry_only: bool, pub types: TypeMappingConfig, pub server: Option<ServerSection>,
}

Fields§

§spec_path: PathBuf

Path to OpenAPI specification file

§output_dir: PathBuf

Output directory for generated code (e.g., “src/gen”)

§module_name: String

Informational label for the generated module. Does NOT pick the on-disk directory (that’s output_dir) or the Rust module path the user mounts the tree at — both of those are the user’s choice. The label is surfaced in the generated mod.rs header as a hint and is otherwise used only by the streaming codegen for naming the SSE client module.

§enable_sse_client: bool

Enable SSE streaming client generation

§enable_async_client: bool

Enable async HTTP client generation

§enable_specta: bool

Enable Specta type derives for frontend integration

§type_mappings: BTreeMap<String, String>

Custom type mappings

§streaming_config: Option<StreamingConfig>

Optional streaming configuration for SSE client generation

§nullable_field_overrides: BTreeMap<String, bool>

Fields that should be treated as nullable even if not marked in the spec Format: “SchemaName.fieldName” -> true

§extensible_enum_overrides: BTreeMap<String, bool>

String-enum schemas that should be rendered as extensible (with a Custom(String) fallback variant) instead of closed enums. Useful when the spec declares a fixed set of values but the API actually returns values outside that set (real-world drift: Cloudflare’s r2_bucket_location declares lowercase but returns uppercase). Format: “SchemaName” -> true

§schema_extensions: Vec<PathBuf>

Additional schema extension files to merge into the main spec These files will be merged additively using simple JSON object merging

§http_client_config: Option<HttpClientConfig>

HTTP client configuration

§retry_config: Option<RetryConfig>

Retry configuration for HTTP requests

§tracing_enabled: bool

Enable request/response tracing

§auth_config: Option<AuthConfig>

Authentication configuration

§enable_registry: bool

Enable operation registry generation (static metadata for CLI/proxy routing)

§registry_only: bool

Generate only the operation registry (skip types, client, streaming)

§types: TypeMappingConfig

Per-format type-mapping strategies driven by the [generator.types] TOML section. Q2.0 introduces this field; with the default value every mapping preserves pre-refactor behavior.

§server: Option<ServerSection>

Opt-in server codegen scope. None ⇒ emit no server code. Set by the [server] section in the TOML config.

Trait Implementations§

Source§

impl Clone for GeneratorConfig

Source§

fn clone(&self) -> GeneratorConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GeneratorConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GeneratorConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more