Interface: JSONSchemaProperty
@providerprotocol/ai / @providerprotocol/ai / JSONSchemaProperty
Interface: JSONSchemaProperty
Section titled “Interface: JSONSchemaProperty”Defined in: src/types/schema.ts:58
JSON Schema property definition.
Describes a single property within a JSON Schema object, including type constraints, validation rules, and nested structure definitions.
Examples
Section titled “Examples”const nameProperty: JSONSchemaProperty = { type: 'string', description: 'User name', minLength: 1, maxLength: 100};const tagsProperty: JSONSchemaProperty = { type: 'array', description: 'List of tags', items: { type: 'string' }, minItems: 1, uniqueItems: true};Properties
Section titled “Properties”additionalProperties?
Section titled “additionalProperties?”
optionaladditionalProperties:boolean
Defined in: src/types/schema.ts:120
Whether additional properties are allowed (object type only)
const?
Section titled “const?”
optionalconst:unknown
Defined in: src/types/schema.ts:69
Constant value this property must equal
default?
Section titled “default?”
optionaldefault:unknown
Defined in: src/types/schema.ts:72
Default value if not provided
description?
Section titled “description?”
optionaldescription:string
Defined in: src/types/schema.ts:63
Human-readable description for the LLM
optionalenum:unknown[]
Defined in: src/types/schema.ts:66
Allowed values (enumeration)
exclusiveMaximum?
Section titled “exclusiveMaximum?”
optionalexclusiveMaximum:number
Defined in: src/types/schema.ts:96
Maximum value exclusive (number/integer types only)
exclusiveMinimum?
Section titled “exclusiveMinimum?”
optionalexclusiveMinimum:number
Defined in: src/types/schema.ts:93
Minimum value exclusive (number/integer types only)
format?
Section titled “format?”
optionalformat:"date"|"uri"|"email"|"date-time"|"uuid"
Defined in: src/types/schema.ts:84
Semantic format hint (string type only)
items?
Section titled “items?”
optionalitems:JSONSchemaProperty
Defined in: src/types/schema.ts:102
Schema for array elements (array type only)
maximum?
Section titled “maximum?”
optionalmaximum:number
Defined in: src/types/schema.ts:90
Maximum value inclusive (number/integer types only)
maxItems?
Section titled “maxItems?”
optionalmaxItems:number
Defined in: src/types/schema.ts:108
Maximum array length (array type only)
maxLength?
Section titled “maxLength?”
optionalmaxLength:number
Defined in: src/types/schema.ts:78
Maximum string length (string type only)
minimum?
Section titled “minimum?”
optionalminimum:number
Defined in: src/types/schema.ts:87
Minimum value inclusive (number/integer types only)
minItems?
Section titled “minItems?”
optionalminItems:number
Defined in: src/types/schema.ts:105
Minimum array length (array type only)
minLength?
Section titled “minLength?”
optionalminLength:number
Defined in: src/types/schema.ts:75
Minimum string length (string type only)
multipleOf?
Section titled “multipleOf?”
optionalmultipleOf:number
Defined in: src/types/schema.ts:99
Value must be divisible by this (number/integer types only)
pattern?
Section titled “pattern?”
optionalpattern:string
Defined in: src/types/schema.ts:81
Regular expression pattern for validation (string type only)
properties?
Section titled “properties?”
optionalproperties:Record<string,JSONSchemaProperty>
Defined in: src/types/schema.ts:114
Nested property definitions (object type only)
required?
Section titled “required?”
optionalrequired:string[]
Defined in: src/types/schema.ts:117
List of required property names (object type only)
type:
JSONSchemaPropertyType
Defined in: src/types/schema.ts:60
The JSON type of this property
uniqueItems?
Section titled “uniqueItems?”
optionaluniqueItems:boolean
Defined in: src/types/schema.ts:111
Whether array elements must be unique (array type only)