Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions tests/draft2019-09/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,31 @@
"valid": true
}
]
},
{
"description": "the default keyword does not interact with required",
"schema": {
"$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"properties": {
"alpha": {
"type": "number",
"default": 5
}
},
"required": ["alpha"]
},
"tests": [
{
"description": "An explicit property passes required",
"data": { "alpha": 1 },
"valid": true
},
{
"description": "missing properties are not filled in with the default by required",
"data": {},
"valid": false
}
]
}
]
26 changes: 26 additions & 0 deletions tests/draft2020-12/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,31 @@
"valid": true
}
]
},
{
"description": "the default keyword does not interact with required",
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"alpha": {
"type": "number",
"default": 5
}
},
"required": ["alpha"]
},
"tests": [
{
"description": "An explicit property passes required",
"data": { "alpha": 1 },
"valid": true
},
{
"description": "missing properties are not filled in with the default by required",
"data": {},
"valid": false
}
]
}
]
25 changes: 25 additions & 0 deletions tests/draft4/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,30 @@
"valid": true
}
]
},
{
"description": "the default keyword does not interact with required",
"schema": {
"type": "object",
"properties": {
"alpha": {
"type": "number",
"default": 5
}
},
"required": ["alpha"]
},
"tests": [
{
"description": "An explicit property passes required",
"data": { "alpha": 1 },
"valid": true
},
{
"description": "missing properties are not filled in with the default by required",
"data": {},
"valid": false
}
]
}
]
25 changes: 25 additions & 0 deletions tests/draft6/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,30 @@
"valid": true
}
]
},
{
"description": "the default keyword does not interact with required",
"schema": {
"type": "object",
"properties": {
"alpha": {
"type": "number",
"default": 5
}
},
"required": ["alpha"]
},
"tests": [
{
"description": "An explicit property passes required",
"data": { "alpha": 1 },
"valid": true
},
{
"description": "missing properties are not filled in with the default by required",
"data": {},
"valid": false
}
]
}
]
25 changes: 25 additions & 0 deletions tests/draft7/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,30 @@
"valid": true
}
]
},
{
"description": "the default keyword does not interact with required",
"schema": {
"type": "object",
"properties": {
"alpha": {
"type": "number",
"default": 5
}
},
"required": ["alpha"]
},
"tests": [
{
"description": "An explicit property passes required",
"data": { "alpha": 1 },
"valid": true
},
{
"description": "missing properties are not filled in with the default by required",
"data": {},
"valid": false
}
]
}
]
Loading