Skip to content

Commit

Permalink
Document array types
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti committed Oct 24, 2023
1 parent 2d74286 commit 5363c44
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions content/2020-12/validation/type.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,22 @@ numbers. Still, JSON Schema provides the `integer` logical type.
{{< instance-fail "A string is not valid" >}}
"foo"
{{< /instance-fail >}}

{{< schema "A schema that describes boolean or array instances" >}}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": [ "boolean", "array" ]
}
{{< /schema >}}

{{< instance-pass "The true boolean is valid" >}}
true
{{< /instance-pass >}}

{{< instance-fail "A number is invalid" >}}
1234
{{< /instance-fail >}}

{{< instance-pass "An arbitrary array is valid" >}}
[ 1, 2, 3 ]
{{< /instance-pass >}}

0 comments on commit 5363c44

Please sign in to comment.