From 214ee7b50703426797e24e36627190d4c31f2e6a Mon Sep 17 00:00:00 2001 From: Andrew Harris Date: Fri, 3 Jul 2026 13:28:41 +0100 Subject: [PATCH] Add note on using defaultValue with a json code field --- .claude/skills/build-plugin/references/ui.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.claude/skills/build-plugin/references/ui.md b/.claude/skills/build-plugin/references/ui.md index acbb9b33..e73ab749 100644 --- a/.claude/skills/build-plugin/references/ui.md +++ b/.claude/skills/build-plugin/references/ui.md @@ -260,6 +260,12 @@ Choosing between them: use **`radio`** when each option reads best on its own li { "type": "code", "name": "body", "label": "Request Body", "language": "json" } ``` +> ⚠️ When `language` is `json`, `defaultValue` must be a JSON object, not a string — the editor calls `JSON.stringify` on it. A string `defaultValue` renders as a quoted, escaped blob instead of formatted JSON. +> +> ```json +> { "type": "code", "name": "body", "language": "json", "defaultValue": { "key": "value" } } +> ``` + **`script`** — inline JavaScript editor: ```json