pub struct TypeMappingConfig {Show 16 fields
pub date_time: DateStrategy,
pub date: DateStrategy,
pub time: DateStrategy,
pub duration: DurationStrategy,
pub uuid: UuidStrategy,
pub byte: ByteStrategy,
pub binary: BinaryStrategy,
pub ipv4: IpStrategy,
pub ipv6: IpStrategy,
pub uri: UriStrategy,
pub email: EmailStrategy,
pub unsigned: bool,
pub format_aliases: BTreeMap<String, String>,
pub shape: Option<TypeShapeConfig>,
pub constraints: Option<TypeConstraintsConfig>,
pub enums: Option<TypeEnumsConfig>,
}Expand description
Configuration for TypeMapper. Mirrors the [generator.types]
TOML section. Defaults flip on every common typed scalar; opt out
per format by setting the strategy to string in TOML.
Fields§
§date_time: DateStrategy§date: DateStrategy§time: DateStrategy§duration: DurationStrategy§uuid: UuidStrategy§byte: ByteStrategy§binary: BinaryStrategy§ipv4: IpStrategy§ipv6: IpStrategy§uri: UriStrategy§email: EmailStrategy§unsigned: boolQ2.1: honor format: uint32 / uint64 integer formats and
map them to u32 / u64 respectively. Default true (cheap,
no extra crate). Set false to revert to the pre-Q2.1
behavior where unsigned formats degraded to i64.
format_aliases: BTreeMap<String, String>Q2.2: user-extensible format aliases applied before standard
format dispatch (e.g. "uuid4" -> "uuid",
"unix-time" -> "int64"). Built-in defaults are merged with
user-supplied entries; user entries win on collision.
shape: Option<TypeShapeConfig>Object/array shape toggles. Filled in by Q2.3, Q2.5, Q2.7.
constraints: Option<TypeConstraintsConfig>Constraint annotation mode. Filled in by Q2.4.
enums: Option<TypeEnumsConfig>Vendor-extension toggles for enums. Filled in by Q2.6.
Implementations§
Source§impl TypeMappingConfig
impl TypeMappingConfig
Sourcepub fn constraint_mode(&self) -> ConstraintMode
pub fn constraint_mode(&self) -> ConstraintMode
Q2.4: constraint-doc emission mode. Defaults to
ConstraintMode::Doc when the
[generator.types.constraints] block is absent or its
mode field is unset.
Sourcepub fn x_enum_varnames_enabled(&self) -> bool
pub fn x_enum_varnames_enabled(&self) -> bool
Q2.6: should x-enum-varnames override the heuristic
PascalCase variant naming? Default true.
Sourcepub fn x_enum_descriptions_enabled(&self) -> bool
pub fn x_enum_descriptions_enabled(&self) -> bool
Q2.6: should x-enum-descriptions emit per-variant doc
comments? Default true.
Sourcepub fn conservative() -> Self
pub fn conservative() -> Self
Pre-Q2 behavior — every format renders as String and
integer formats degrade to i64. Users opt in via
--types-conservative when bisecting regressions introduced
by typed-scalar adoption.
Trait Implementations§
Source§impl Clone for TypeMappingConfig
impl Clone for TypeMappingConfig
Source§fn clone(&self) -> TypeMappingConfig
fn clone(&self) -> TypeMappingConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more