feat(codegen): support arbitrary maps as prop type

This commit is contained in:
pyrite 2025-08-10 18:10:44 +02:00
parent 4e19c00700
commit 1aed7993c2
Signed by: pyrite
GPG key ID: 7F1BA9170CD35D15

View file

@ -25,6 +25,7 @@ pub enum PropertyType {
Enum(Enum),
Nested(Box<Object>),
Array(Box<PropertyType>),
Any,
}
impl PropertyType {
@ -79,6 +80,9 @@ impl PropertyType {
#ns::#name
})
}
Self::Any => Some(quote! {
serde_json::Value
}),
}
}
}
@ -183,6 +187,19 @@ impl Property {
r#type: PropertyType::Nested(Box::new(composite)),
})
}
OpenApiType {
r#type: Some("object"),
properties: None,
..
} => Some(Self {
field_name,
name,
description,
required,
nullable: false,
r#type: PropertyType::Any,
deprecated: schema.deprecated,
}),
OpenApiType {
r#type: Some("object"),
..