Skip to content

Commit

Permalink
refactor: add more fields to JSON schema (#1052)
Browse files Browse the repository at this point in the history
  • Loading branch information
sigoden authored Dec 12, 2024
1 parent 1d8892a commit 1a4a2fc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,21 @@ pub struct FunctionDeclaration {

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct JsonSchema {
#[serde(rename = "type")]
pub type_value: String,
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
pub type_value: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub properties: Option<IndexMap<String, JsonSchema>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub items: Option<Box<JsonSchema>>,
#[serde(rename = "anyOf", skip_serializing_if = "Option::is_none")]
pub any_of: Option<Vec<JsonSchema>>,
#[serde(rename = "enum", skip_serializing_if = "Option::is_none")]
pub enum_value: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub default: Option<Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub required: Option<Vec<String>>,
}

Expand Down

0 comments on commit 1a4a2fc

Please sign in to comment.