Skip to content

Commit 50a65d0

Browse files
committed
Use generateDefaultValue for object and array defaults
1 parent e1b015e commit 50a65d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

client/src/components/ToolsTab.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Label } from "@/components/ui/label";
66
import { TabsContent } from "@/components/ui/tabs";
77
import { Textarea } from "@/components/ui/textarea";
88
import DynamicJsonForm, { JsonSchemaType, JsonValue } from "./DynamicJsonForm";
9+
import { generateDefaultValue } from "@/utils/schemaUtils";
910
import {
1011
ListToolsResult,
1112
Tool,
@@ -215,8 +216,7 @@ const ToolsTab = ({
215216
items: prop.items,
216217
}}
217218
value={
218-
(params[key] as JsonValue) ??
219-
(prop.type === "array" ? [] : {})
219+
(params[key] as JsonValue) ?? generateDefaultValue(prop)
220220
}
221221
onChange={(newValue: JsonValue) => {
222222
setParams({

0 commit comments

Comments
 (0)