feat(codegen): various improvements to robustness

This commit is contained in:
pyrite 2025-06-27 16:59:38 +02:00
parent a90bcb00c4
commit cf98d24090
Signed by: pyrite
GPG key ID: 7F1BA9170CD35D15
7 changed files with 344 additions and 96 deletions

View file

@ -77,6 +77,11 @@ impl EnumVariantTupleValue {
format: Some("int32"),
..
} => Some(Self::Primitive(PrimitiveType::I32)),
OpenApiType {
r#type: Some("number"),
format: Some("float") | None,
..
} => Some(Self::Primitive(PrimitiveType::Float)),
_ => None,
}
}
@ -146,6 +151,7 @@ impl EnumVariantTupleValue {
pub fn is_comparable(&self, resolved: &ResolvedSchema) -> bool {
match self {
Self::Primitive(PrimitiveType::Float) => false,
Self::Primitive(_) => true,
Self::Enum { inner, .. } => inner.is_comparable(resolved),
Self::Ref { ty_name } | Self::ArrayOfRefs { ty_name } => resolved