Sun calculation js library which is fully based on formula from http://aa.quae.nl/en/reken/zonpositie.html
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
113 lines
3.0 KiB
113 lines
3.0 KiB
7 years ago
|
[
|
||
|
{
|
||
|
"description": "allOf",
|
||
|
"schema": {
|
||
|
"allOf": [
|
||
|
{
|
||
|
"properties": {
|
||
|
"bar": {"type": "integer"}
|
||
|
},
|
||
|
"required": ["bar"]
|
||
|
},
|
||
|
{
|
||
|
"properties": {
|
||
|
"foo": {"type": "string"}
|
||
|
},
|
||
|
"required": ["foo"]
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
"tests": [
|
||
|
{
|
||
|
"description": "allOf",
|
||
|
"data": {"foo": "baz", "bar": 2},
|
||
|
"valid": true
|
||
|
},
|
||
|
{
|
||
|
"description": "mismatch second",
|
||
|
"data": {"foo": "baz"},
|
||
|
"valid": false
|
||
|
},
|
||
|
{
|
||
|
"description": "mismatch first",
|
||
|
"data": {"bar": 2},
|
||
|
"valid": false
|
||
|
},
|
||
|
{
|
||
|
"description": "wrong type",
|
||
|
"data": {"foo": "baz", "bar": "quux"},
|
||
|
"valid": false
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"description": "allOf with base schema",
|
||
|
"schema": {
|
||
|
"properties": {"bar": {"type": "integer"}},
|
||
|
"required": ["bar"],
|
||
|
"allOf" : [
|
||
|
{
|
||
|
"properties": {
|
||
|
"foo": {"type": "string"}
|
||
|
},
|
||
|
"required": ["foo"]
|
||
|
},
|
||
|
{
|
||
|
"properties": {
|
||
|
"baz": {"type": "null"}
|
||
|
},
|
||
|
"required": ["baz"]
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
"tests": [
|
||
|
{
|
||
|
"description": "valid",
|
||
|
"data": {"foo": "quux", "bar": 2, "baz": null},
|
||
|
"valid": true
|
||
|
},
|
||
|
{
|
||
|
"description": "mismatch base schema",
|
||
|
"data": {"foo": "quux", "baz": null},
|
||
|
"valid": false
|
||
|
},
|
||
|
{
|
||
|
"description": "mismatch first allOf",
|
||
|
"data": {"bar": 2, "baz": null},
|
||
|
"valid": false
|
||
|
},
|
||
|
{
|
||
|
"description": "mismatch second allOf",
|
||
|
"data": {"foo": "quux", "bar": 2},
|
||
|
"valid": false
|
||
|
},
|
||
|
{
|
||
|
"description": "mismatch both",
|
||
|
"data": {"bar": 2},
|
||
|
"valid": false
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"description": "allOf simple types",
|
||
|
"schema": {
|
||
|
"allOf": [
|
||
|
{"maximum": 30},
|
||
|
{"minimum": 20}
|
||
|
]
|
||
|
},
|
||
|
"tests": [
|
||
|
{
|
||
|
"description": "valid",
|
||
|
"data": 25,
|
||
|
"valid": true
|
||
|
},
|
||
|
{
|
||
|
"description": "mismatch one",
|
||
|
"data": 35,
|
||
|
"valid": false
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
]
|