-
Notifications
You must be signed in to change notification settings - Fork 23
/
link.schema.json
130 lines (130 loc) · 4.39 KB
/
link.schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://readium.org/webpub-manifest/schema/link.schema.json",
"title": "Link Object for the Readium Web Publication Manifest",
"type": "object",
"properties": {
"href": {
"description": "URI or URI template of the linked resource",
"type": "string"
},
"type": {
"description": "MIME type of the linked resource",
"type": "string"
},
"templated": {
"description": "Indicates that a URI template is used in href",
"type": "boolean"
},
"title": {
"description": "Title of the linked resource",
"type": "string"
},
"rel": {
"description": "Relation between the linked resource and its containing collection",
"type": [
"string",
"array"
],
"items": {
"type": "string"
}
},
"properties": {
"description": "Properties associated to the linked resource",
"type": "object",
"properties": {
"page": {
"description": "Indicates how the linked resource should be displayed in a reading environment that displays synthetic spreads.",
"type": "string",
"enum": [
"left",
"right",
"center"
]
}
},
"allOf": [
{ "$ref": "extensions/epub/properties.schema.json" },
{ "$ref": "extensions/encryption/properties.schema.json" },
{ "$ref": "extensions/divina/properties.schema.json" },
{ "$ref": "experimental/presentation/properties.schema.json" },
{ "$ref": "https://drafts.opds.io/schema/properties.schema.json" }
]
},
"height": {
"description": "Height of the linked resource in pixels",
"type": "integer",
"exclusiveMinimum": 0
},
"width": {
"description": "Width of the linked resource in pixels",
"type": "integer",
"exclusiveMinimum": 0
},
"bitrate": {
"description": "Bitrate of the linked resource in kbps",
"type": "number",
"exclusiveMinimum": 0
},
"duration": {
"description": "Length of the linked resource in seconds",
"type": "number",
"exclusiveMinimum": 0
},
"language": {
"description": "Expected language of the linked resource",
"type": [
"string",
"array"
],
"items": {
"type": "string",
"pattern": "^((?<grandfathered>(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?<language>([A-Za-z]{2,3}(-(?<extlang>[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-(?<script>[A-Za-z]{4}))?(-(?<region>[A-Za-z]{2}|[0-9]{3}))?(-(?<variant>[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?<extension>[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?<privateUse>x(-[A-Za-z0-9]{1,8})+))?)|(?<privateUse2>x(-[A-Za-z0-9]{1,8})+))$"
},
"pattern": "^((?<grandfathered>(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?<language>([A-Za-z]{2,3}(-(?<extlang>[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-(?<script>[A-Za-z]{4}))?(-(?<region>[A-Za-z]{2}|[0-9]{3}))?(-(?<variant>[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?<extension>[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?<privateUse>x(-[A-Za-z0-9]{1,8})+))?)|(?<privateUse2>x(-[A-Za-z0-9]{1,8})+))$"
},
"alternate": {
"description": "Alternate resources for the linked resource",
"type": "array",
"items": {
"$ref": "link.schema.json"
}
},
"children": {
"description": "Resources that are children of the linked resource, in the context of a given collection role",
"type": "array",
"items": {
"$ref": "link.schema.json"
}
}
},
"required": [
"href"
],
"if": {
"properties": {
"templated": {
"enum": [
false, null
]
}
}
},
"then": {
"properties": {
"href": {
"type": "string",
"format": "uri-reference"
}
}
},
"else": {
"properties": {
"href": {
"type": "string",
"format": "uri-template"
}
}
}
}