mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-17 23:32:43 -07:00
Fix settings validation to properly respect additionalProperties: false
This commit is contained in:
@@ -54,9 +54,10 @@ function buildZodSchemaFromJsonSchema(def: any): z.ZodTypeAny {
|
||||
}
|
||||
shape[key] = propSchema;
|
||||
}
|
||||
schema = z.object(shape).passthrough();
|
||||
// Don't apply passthrough() here - we'll determine the behavior below
|
||||
schema = z.object(shape);
|
||||
} else {
|
||||
schema = z.object({}).passthrough();
|
||||
schema = z.object({});
|
||||
}
|
||||
|
||||
if (def.additionalProperties === false) {
|
||||
@@ -65,6 +66,9 @@ function buildZodSchemaFromJsonSchema(def: any): z.ZodTypeAny {
|
||||
schema = schema.catchall(
|
||||
buildZodSchemaFromJsonSchema(def.additionalProperties),
|
||||
);
|
||||
} else {
|
||||
// Default to passthrough when additionalProperties is not explicitly false
|
||||
schema = schema.passthrough();
|
||||
}
|
||||
|
||||
return schema;
|
||||
|
||||
Reference in New Issue
Block a user