Skip to content

Commit

Permalink
Merge pull request #1117 from firoxer/patch-1
Browse files Browse the repository at this point in the history
doc: add examples of common `optional-keys` and `required-keys` usage
  • Loading branch information
o-s-silva authored Nov 12, 2024
2 parents 1749e03 + 42c0bff commit 16623e2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1458,10 +1458,22 @@ Making keys optional or required:
; [:x {:optional true} int?]
; [:y {:optional true} int?]]

(mu/required-keys [:map [:x {:optional true} int?] [:y int?]])
(mu/optional-keys [:map [:x int?] [:y int?]]
[:x])
;[:map
; [:x {:optional true} int?]
; [:y int?]]

(mu/required-keys [:map [:x {:optional true} int?] [:y {:optional true} int?]])
;[:map
; [:x int?]
; [:y int?]]

(mu/required-keys [:map [:x {:optional true} int?] [:y {:optional true} int?]]
[:x])
;[:map
; [:x int?]
; [:y {:optional true} int?]]
```

Closing and opening all `:map` schemas recursively:
Expand Down

0 comments on commit 16623e2

Please sign in to comment.