Skip to content

Commit 73ff1b4

Browse files
author
abluchet
committed
HAL: Use a local version of hyperschema
1 parent 285ff25 commit 73ff1b4

File tree

3 files changed

+107
-6
lines changed

3 files changed

+107
-6
lines changed

tests/Fixtures/JsonHal/base.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"definitions": {
3+
"id": {
4+
"title": "ID",
5+
"description": "Unique ID",
6+
"type": "string"
7+
},
8+
"name": {
9+
"title": "Name",
10+
"description": "Name of a resource, link, action, etc.",
11+
"type": "string"
12+
},
13+
"class": {
14+
"title": "Class Name",
15+
"description": "Class name of of a resource, link, action, etc.",
16+
"type": "string"
17+
},
18+
"classes": {
19+
"title": "Class Array",
20+
"description": "An array of classes",
21+
"type": "array",
22+
"items": { "$ref": "#/definitions/class" }
23+
},
24+
"mediaType": {
25+
"title": "Media Type",
26+
"description": "A media type",
27+
"type": "string"
28+
},
29+
"mediaTypes": {
30+
"title": "Media Types",
31+
"description": "A list of media types",
32+
"type": "array",
33+
"items": { "$ref": "#/definitions/mediaType" }
34+
},
35+
"title": {
36+
"title": "Title",
37+
"description": "A title for a resource, link, action, etc.",
38+
"type": "string"
39+
},
40+
"description": {
41+
"title": "Description",
42+
"description": "A description for a resource, link, action, etc.",
43+
"type": "string"
44+
},
45+
"prefix": {
46+
"title": "Prefix",
47+
"description": "Prefix used for curies",
48+
"type": "string"
49+
}
50+
}
51+
}

tests/Fixtures/JsonHal/jsonhal.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,26 @@
3838
"type": "object",
3939
"properties": {
4040
"name": {
41-
"$ref": "http://hyperschema.org/core/base#/definitions/name"
41+
"$ref": "base.json#/definitions/name"
4242
},
4343
"href": {
4444
"anyOf": [
4545
{
46-
"$ref": "http://hyperschema.org/core/link#/definitions/href"
46+
"$ref": "link.json#/definitions/href"
4747
},
4848
{
49-
"$ref": "http://hyperschema.org/core/link#/definitions/hrefTemplated"
49+
"$ref": "link.json#/definitions/hrefTemplated"
5050
}
5151
]
5252
},
5353
"templated": {
54-
"$ref": "http://hyperschema.org/core/link#/definitions/isTemplated"
54+
"$ref": "link.json#/definitions/isTemplated"
5555
},
5656
"type": {
57-
"$ref": "http://hyperschema.org/core/base#/definitions/mediaType"
57+
"$ref": "base.json#/definitions/mediaType"
5858
},
5959
"deprecation": {
60-
"$ref": "http://hyperschema.org/core/link#/definitions/isDeprecated"
60+
"$ref": "link.json#/definitions/isDeprecated"
6161
}
6262
},
6363
"required": [

tests/Fixtures/JsonHal/link.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"definitions": {
3+
"href": {
4+
"title": "HREF",
5+
"description": "A hyperlink URL",
6+
"type": "string"
7+
},
8+
"hrefTemplated": {
9+
"title": "Templated HREF",
10+
"description": "A hyperlink that is a URI template (RFC 6570)",
11+
"type": "string"
12+
},
13+
"isTemplated": {
14+
"title": "Is URI Templated?",
15+
"description": "Specifies whether or not a link is using URI templates",
16+
"type": "boolean"
17+
},
18+
"isDeprecated": {
19+
"title": "Is URI Deprecated?",
20+
"description": "Specifies whether or not a link is deprecated",
21+
"type": "boolean"
22+
},
23+
"queryStringURITemplate": {
24+
"title": "Query String URI Template",
25+
"description": "Specifies a query string URI template (RFC 6570)",
26+
"type": "string"
27+
},
28+
"rel": {
29+
"title": "Link Relation",
30+
"description": "A link relation",
31+
"type": "string"
32+
},
33+
"rels": {
34+
"title": "Link Relation Array",
35+
"description": "An array of link relations",
36+
"type": "array",
37+
"items": { "$ref": "#/definitions/rel" }
38+
},
39+
"label": {
40+
"title": "Label",
41+
"description": "Human-readable label for link",
42+
"type": "string"
43+
},
44+
"transclude": {
45+
"title": "Should transclude?",
46+
"description": "Specify whether or not a link should be transcluded",
47+
"type": "boolean"
48+
}
49+
}
50+
}

0 commit comments

Comments
 (0)