pub struct ConfigFile {
pub generator: GeneratorSection,
pub features: FeaturesSection,
pub http_client: Option<HttpClientSection>,
pub streaming: Option<StreamingSection>,
pub server: Option<ServerSection>,
pub client: Option<ClientSection>,
pub nullable_overrides: BTreeMap<String, bool>,
pub extensible_enums: BTreeMap<String, bool>,
pub type_mappings: BTreeMap<String, String>,
pub types: TypeMappingConfig,
}Expand description
Root configuration loaded from TOML file
Fields§
§generator: GeneratorSection§features: FeaturesSection§http_client: Option<HttpClientSection>§streaming: Option<StreamingSection>§server: Option<ServerSection>Server codegen opt-in. Absent or empty operations list ⇒ no
server code emitted. See docs/planning/server-codegen.md.
client: Option<ClientSection>Optional HTTP-client operation scope. Absent means all operations.
nullable_overrides: BTreeMap<String, bool>§extensible_enums: BTreeMap<String, bool>Force a closed string-enum schema to be rendered as an extensible enum
(with a Custom(String) fallback variant). Use when the spec under-
declares the enum and the API returns values outside the declared set.
Format: "SchemaName" = true. Mirror of nullable_overrides.
type_mappings: BTreeMap<String, String>§types: TypeMappingConfigNormalized type-mapping configuration.
TOML deserialization accepts canonical [generator.types] and the
temporary top-level [types] compatibility alias. Serialization always
writes this value back in the canonical nested location.
Implementations§
Source§impl ConfigFile
impl ConfigFile
Sourcepub fn load(path: &Path) -> Result<Self, GeneratorError>
pub fn load(path: &Path) -> Result<Self, GeneratorError>
Load and validate configuration from a TOML file.
Relative spec_path, output_dir, and schema_extensions values are
resolved against the directory containing path, independent of the
process’s current working directory.
Sourcepub fn into_generator_config(self) -> GeneratorConfig
pub fn into_generator_config(self) -> GeneratorConfig
Convert to internal GeneratorConfig
Trait Implementations§
Source§impl Clone for ConfigFile
impl Clone for ConfigFile
Source§fn clone(&self) -> ConfigFile
fn clone(&self) -> ConfigFile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more