generated from stac-extensions/template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.json
187 lines (187 loc) · 4.71 KB
/
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://stac-extensions.github.io/language/v1.0.0/schema.json#",
"title": "Language (I18N) Extension",
"description": "STAC Language (I18N) Extension for STAC.",
"type": "object",
"required": [
"stac_extensions"
],
"properties": {
"stac_extensions": {
"type": "array",
"contains": {
"const": "https://stac-extensions.github.io/language/v1.0.0/schema.json"
}
},
"links": {
"type": "array",
"items": {
"$refs": "#/definitions/href_fields"
}
}
},
"oneOf": [
{
"$comment": "This is the schema for STAC Items.",
"type": "object",
"required": [
"type",
"properties"
],
"properties": {
"type": {
"const": "Feature"
},
"properties": {
"$ref": "#/definitions/lang_fields"
},
"assets": {
"$ref": "#/definitions/assets"
}
}
},
{
"$comment": "This is the schema for STAC Collections.",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"const": "Collection"
}
},
"anyOf": [
{
"$comment": "This is the schema for the top-level fields in a Collection.",
"allOf": [
{
"$ref": "#/definitions/lang_fields"
}
]
},
{
"$comment": "This validates the fields in Collection Assets, but does not require them.",
"required": [
"assets"
],
"properties": {
"assets": {
"$ref": "#/definitions/assets"
}
}
},
{
"$comment": "This is the schema for the fields in Item Asset Definitions. It doesn't require any fields.",
"required": [
"item_assets"
],
"properties": {
"item_assets": {
"$ref": "#/definitions/assets"
}
}
},
{
"$comment": "This is the schema for the fields in Summaries. By default, only checks the existence of the properties, but not the schema of the summaries.",
"required": [
"summaries"
],
"properties": {
"summaries": {
"anyOf": [
{"required": ["language"]},
{"required": ["languages"]}
]
}
}
}
]
},
{
"$comment": "This is the schema for STAC Catalogs, all top-level.",
"type": "object",
"required": [
"type",
"language"
],
"properties": {
"type": {
"const": "Catalog"
}
},
"allOf": [
{
"$ref": "#/definitions/lang_fields"
}
]
}
],
"definitions": {
"assets": {
"type" : "object",
"additionalProperties": {
"$refs": "#/definitions/href_fields"
}
},
"language_code": {
"$comment": "Source for the pattern is https://www.regextester.com/103066",
"type": "string",
"pattern": "^((?:(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))|((?:([A-Za-z]{2,3}(-(?:[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-(?:[A-Za-z]{4}))?(-(?:[A-Za-z]{2}|[0-9]{3}))?(-(?:[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?:[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?:x(-[A-Za-z0-9]{1,8})+))?)|(?:x(-[A-Za-z0-9]{1,8})+))$"
},
"language_object": {
"type": "object",
"required": [
"code"
],
"properties": {
"code": {
"$ref": "#/definitions/language_code"
},
"name": {
"type": "string",
"minLength": 1
},
"alternate": {
"type": "string",
"minLength": 1
},
"dir": {
"type": "string",
"enum": [
"ltr",
"rtl"
],
"default": "ltr"
}
}
},
"lang_fields": {
"type": "object",
"required": [
"language"
],
"properties": {
"language": {
"$ref": "#/definitions/language_object"
},
"languages": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/language_object"
}
}
}
},
"href_fields": {
"type": "object",
"properties": {
"hreflang": {
"$ref": "#/definitions/language_code"
}
}
}
}
}