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:
1 file changed
+1
-1
@@ -22,10 +22,10 @@ export function buildJsonSchemaDocument(
|
||||
}
|
||||
|
||||
return {
|
||||
...jsonSchema,
|
||||
$schema: JSON_SCHEMA_DRAFT_2020_12,
|
||||
title: options.title,
|
||||
description: options.description,
|
||||
...jsonSchema,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user