fix: place spread before explicit metadata in buildJsonSchemaDocument

Move ...jsonSchema spread to come before the explicit $schema, title,
and description properties so that schema annotations can never silently
override the values passed via options.
This commit is contained in:
Cursor Agent committed 2026-03-30 21:55:32 +00:00
1 parent f1793ad2eb
commit 782716bd83
1 file changed
+1 -1
+1 -1
View File
@@ -22,10 +22,10 @@ export function buildJsonSchemaDocument(
}
return {
...jsonSchema,
$schema: JSON_SCHEMA_DRAFT_2020_12,
title: options.title,
description: options.description,
...jsonSchema,
};
}