Skip to content

Commit 605342c

Browse files
authored
Merge pull request #348 from d4v1d03/main
extending an array in a given schema
2 parents 457f6fd + 2127299 commit 605342c

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)