Skip to content

Commit 2127299

Browse files
committed
extending an array in a given schema
Signed-off-by: d4v1d03 <[email protected]>
1 parent 457f6fd commit 2127299

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/user_docs/support/faq-kcl.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2586,3 +2586,17 @@ The command to validate the JSON data below gives the output `Validate success!`
25862586
```bash
25872587
kcl vet data.json schema.k
25882588
```
2589+
2590+
## 63. How can i extend an array's default value in a given schema?
2591+
2592+
We use the += operator to extend the default values in an array.
2593+
2594+
```KCL
2595+
schema MyApp:
2596+
args: [str] = ["default", "args"]
2597+
2598+
app = MyApp {
2599+
args += ["additional", "args"]
2600+
}
2601+
```
2602+

0 commit comments

Comments
 (0)