Impl Default trait for JSONSchemaDefine

In most cases, only a few properties of JSONSchemaDefine are used, and it seems cumbersome to explicitly declare other properties.
This commit is contained in:
Hytracen
2023-12-30 01:57:45 +08:00
parent f88cc6b42e
commit bfedc7f3cd
3 changed files with 15 additions and 8 deletions

View File

@@ -197,6 +197,19 @@ pub struct JSONSchemaDefine {
pub items: Option<Box<JSONSchemaDefine>>,
}
impl Default for JSONSchemaDefine {
fn default() -> Self {
Self {
schema_type: None,
description: None,
enum_values: None,
properties: None,
required: None,
items: None,
}
}
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct FunctionParameters {
#[serde(rename = "type")]