Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions inc/Core/EventSchemaProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class EventSchemaProvider {
),
'occurrenceDates' => array(
'type' => 'array',
'items' => array( 'type' => 'string' ),
'required' => false,
'description' => 'For recurring events: array of specific dates (YYYY-MM-DD) when the event occurs within the start/end range. If provided, event displays only on these dates instead of every day in the range.',
'schema_property' => null,
Expand Down Expand Up @@ -331,6 +332,15 @@ private static function fieldsToToolParameters( array $fields ): array {
$param['enum'] = $field['enum'];
}

// JSON Schema requires `items` on every array type, and OpenAI's
// strict tool schema validation rejects arrays without it.
// Propagate `items` from the field declaration; default to a string
// array when the declaration is incomplete to avoid emitting an
// invalid schema that would fail at runtime.
if ( 'array' === ( $field['type'] ?? '' ) ) {
$param['items'] = $field['items'] ?? array( 'type' => 'string' );
}

$params[ $key ] = $param;
}

Expand Down
Loading