pub struct PropertySchema {
pub schema_type: String,
pub description: Option<String>,
pub enum_values: Option<Vec<String>>,
pub default: Option<Value>,
pub minimum: Option<f64>,
pub maximum: Option<f64>,
pub items: Option<Box<PropertySchema>>,
pub any_of: Option<Vec<PropertySchema>>,
pub enriched: Option<bool>,
}Expand description
JSON Schema property definition for a tool parameter.
Fields§
§schema_type: StringJSON Schema type: “string”, “number”, “integer”, “boolean”, “array”, “object”.
Empty when Self::any_of is set — JSON Schema treats type
and anyOf as alternatives, and the serializer skips empty
type on the wire so the rendered schema stays valid for
LLM tool-call validators.
description: Option<String>Human-readable description of this parameter.
enum_values: Option<Vec<String>>Allowed values (enum constraint).
default: Option<Value>§minimum: Option<f64>Minimum value (for number/integer).
maximum: Option<f64>Maximum value (for number/integer).
items: Option<Box<PropertySchema>>Items schema (for array type).
any_of: Option<Vec<PropertySchema>>Schema alternatives — used when a parameter accepts shapes
that can’t be unified under one type (e.g. a Jira
customfield that’s a select on Project A and free text on
Project B). Mutually exclusive with schema_type per JSON
Schema’s anyOf semantics — when set, Self::schema_type
is empty and the serializer skips it.
enriched: Option<bool>Marker that this field was added/modified by an enricher.
Implementations§
Source§impl PropertySchema
impl PropertySchema
Sourcepub fn string_enum(values: &[&str], description: &str) -> Self
pub fn string_enum(values: &[&str], description: &str) -> Self
Create a string property with enum values.
Sourcepub fn integer(description: &str, min: Option<f64>, max: Option<f64>) -> Self
pub fn integer(description: &str, min: Option<f64>, max: Option<f64>) -> Self
Create an integer property with optional min/max.
Sourcepub fn array(items: PropertySchema, description: &str) -> Self
pub fn array(items: PropertySchema, description: &str) -> Self
Create an array property with items schema.
Sourcepub fn any_of(description: &str, schemas: Vec<PropertySchema>) -> Self
pub fn any_of(description: &str, schemas: Vec<PropertySchema>) -> Self
Create a schema that accepts any of several alternatives —
JSON Schema’s anyOf. Used when a parameter can take
shapes that don’t fit under a single type (e.g. a custom
field with different option lists across projects). The
outer schema carries the description and anyOf array;
schema_type is left empty so the wire format is a valid
anyOf-only schema.
Trait Implementations§
Source§impl Clone for PropertySchema
impl Clone for PropertySchema
Source§fn clone(&self) -> PropertySchema
fn clone(&self) -> PropertySchema
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more