Skip to content

Commit 716468a

Browse files
committed
example schemas with oneOf/anyOf with null types
1 parent fb2c4df commit 716468a

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

test/schemas/ofNulls/anyOfNull.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"title": "JSON API Schema",
4+
"description": "This is a schema for responses in the JSON API format. For more, see http://jsonapi.org",
5+
"type": "object",
6+
"properties": {
7+
"payment": {
8+
"anyOf": [
9+
{
10+
"type": "null"
11+
},
12+
{
13+
"type": "string"
14+
}
15+
]
16+
}
17+
}
18+
}

test/schemas/ofNulls/oneOfNull.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"title": "JSON API Schema",
4+
"description": "This is a schema for responses in the JSON API format. For more, see http://jsonapi.org",
5+
"type": "object",
6+
"properties": {
7+
"payment": {
8+
"oneOf": [
9+
{
10+
"type": "null"
11+
},
12+
{
13+
"type": "string"
14+
}
15+
]
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)