Skip to content

Commit 16623e2

Browse files
authored
Merge pull request #1117 from firoxer/patch-1
doc: add examples of common `optional-keys` and `required-keys` usage
2 parents 1749e03 + 42c0bff commit 16623e2

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

README.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -1458,10 +1458,22 @@ Making keys optional or required:
14581458
; [:x {:optional true} int?]
14591459
; [:y {:optional true} int?]]
14601460

1461-
(mu/required-keys [:map [:x {:optional true} int?] [:y int?]])
1461+
(mu/optional-keys [:map [:x int?] [:y int?]]
1462+
[:x])
1463+
;[:map
1464+
; [:x {:optional true} int?]
1465+
; [:y int?]]
1466+
1467+
(mu/required-keys [:map [:x {:optional true} int?] [:y {:optional true} int?]])
14621468
;[:map
14631469
; [:x int?]
14641470
; [:y int?]]
1471+
1472+
(mu/required-keys [:map [:x {:optional true} int?] [:y {:optional true} int?]]
1473+
[:x])
1474+
;[:map
1475+
; [:x int?]
1476+
; [:y {:optional true} int?]]
14651477
```
14661478

14671479
Closing and opening all `:map` schemas recursively:

0 commit comments

Comments
 (0)