feat(codegen): support arbitrary maps as prop type
This commit is contained in:
parent
4e19c00700
commit
1aed7993c2
1 changed files with 17 additions and 0 deletions
|
|
@ -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"),
|
||||
..
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue