Skip to content

Commit 214ee7b

Browse files
Add note on using defaultValue with a json code field
1 parent eb6d864 commit 214ee7b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • .claude/skills/build-plugin/references

.claude/skills/build-plugin/references/ui.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,12 @@ Choosing between them: use **`radio`** when each option reads best on its own li
260260
{ "type": "code", "name": "body", "label": "Request Body", "language": "json" }
261261
```
262262

263+
> ⚠️ 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.
264+
>
265+
> ```json
266+
> { "type": "code", "name": "body", "language": "json", "defaultValue": { "key": "value" } }
267+
> ```
268+
263269
**`script`** — inline JavaScript editor:
264270
265271
```json

0 commit comments

Comments
 (0)