Tags: asyncapi/modelina
Tags
feat: support non-object model types for Rust (#2372) feat: support non-object model types for rust Those model types are common when using GET parameters in an OpenAPI document. Typescript already has a TypeRenderer. This adds an equivalent for Rust. However, instead of using a Rust type aliases, this PR uses the New Type Idiom. There are two main advantages to using the New Type idiom: compile-time value type validation and a bypass of the rust orphan rule (see https://effective-rust.com/newtype.html). The second advantage will be needed to implement model validation. Likely this validation will come from an external trait. Rust only allows adding external trait implementations to types that are internal to the crate (type aliases do not count).
PreviousNext