Skip to content

Commit

Permalink
Update nested-data.html.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethteh90 committed Sep 19, 2024
1 parent 4e8646c commit 623b7e7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions docsite/source/nested-data.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,10 @@ If you have a value that could be `nil` or an array of hashes, use the !nil? ope
# This allows "people": null or "people": [{ "name": "Alice", "age": 19 }, { "name": "Bob", "age": 20 }]
schema = Dry::Schema.Params do
required(:people).maybe(:array) do
!nil? do
hash do
required(:name).filled(:string)
required(:age).filled(:integer, gteq?: 18)
end
nil? | each(:hash) do
required(:name).filled(:string)
required(:age).filled(:integer, gteq?: 18)
end
end
end
```

0 comments on commit 623b7e7

Please sign in to comment.