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

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions tests/draft4/hyper/fragmentResolution.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[
{
"description": "fragmentResolution",
"schema": {
"$ref": "http://json-schema.org/draft-04/hyper-schema#"
},
"tests": [
{
"description": "any string will do",
"data": {
"fragmentResolution": "random"
},
"valid": true
},
{
"description": "boolean not OK",
"data": {
"fragmentResolution": false
},
"valid": false
},
{
"description": "number not OK",
"data": {
"fragmentResolution": 42
},
"valid": false
},
{
"description": "array not OK",
"data": {
"fragmentResolution": ["ohai!"]
},
"valid": false
},
{
"description": "object not OK",
"data": {
"fragmentResolution": {
"something": "funny"
}
},
"valid": false
}
]
}
]
60 changes: 60 additions & 0 deletions tests/draft4/hyper/links.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[
{
"description": "a single link",
"schema": {
"$ref": "http://json-schema.org/draft-04/hyper-schema#"
},
"tests": [
{
"description": "valid link",
"data": {
"links": [
{
"href": "http://example.com/",
"rel": "self"
}
]
},
"valid": true
},
{
"description": "not an array",
"data": {
"links": "ohai!"
},
"valid": false
},
{
"description": "LDO not an object",
"data": {
"links": [
"ohai!"
]
},
"valid": false
},
{
"description": "missing href",
"data": {
"links": [
{
"rel": "self"
}
]
},
"valid": false
},
{
"description": "missing rel",
"data": {
"links": [
{
"href": "http://example.com/"
}
]
},
"valid": false
}
]
}
]
28 changes: 28 additions & 0 deletions tests/draft4/hyper/media.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[
{
"description": "media property",
"schema": {
"$ref": "http://json-schema.org/draft-04/hyper-schema#"
},
"tests": [
{
"description": "valid media specifier",
"data": {
"type": "string",
"media": {
"binaryEncoding": "base64",
"type": "image/png"
}
},
"valid": true
},
{
"description": "not an object",
"data": {
"links": "ohai!"
},
"valid": false
}
]
}
]
54 changes: 54 additions & 0 deletions tests/draft4/hyper/readOnly.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[
{
"description": "readOnly",
"schema": {
"$ref": "http://json-schema.org/draft-04/hyper-schema#"
},
"tests": [
{
"description": "boolean false is OK",
"data": {
"readOnly": false
},
"valid": true
},
{
"description": "boolean true is OK",
"data": {
"readOnly": true
},
"valid": true
},
{
"description": "string is not OK",
"data": {
"readOnly": "ohai"
},
"valid": false
},
{
"description": "number not OK",
"data": {
"readOnly": 42
},
"valid": false
},
{
"description": "array not OK",
"data": {
"readOnly": ["ohai!"]
},
"valid": false
},
{
"description": "object not OK",
"data": {
"readOnly": {
"something": "funny"
}
},
"valid": false
}
]
}
]