Project

General

Profile

« Previous | Next » 

Revision 09634f34

Added by koszko over 1 year ago

fix local reference in common_definitions schema

  • common_definitions-1.0.1.schema.json: change "$ref" line
  • : rename to version 1.0.1
  • api_mapping_description-1.0.1.schema.json, api_query_result-1.0.1.schema.json, api_resource_description-1.0.1.schema.json, api_source_description-1.0.1.schema.json, package_source-1.0.1.schema.json: update regular expression pattern for validation of "$schema" property
  • : update version in "$id" property

View differences:

api_mapping_description-1.0.1.schema.json
1
{
2
    "$schema": "http://json-schema.org/draft-07/schema#",
3
    "$id": "https://hydrilla.koszko.org/schemas/api_mapping_description-1.0.1.schema.json",
4
    "title": "Mapping description",
5
    "description": "Definition of a Hydrilla mapping, as served through HTTP API",
6
    "allOf": [{
7
	"$ref": "./common_definitions-1.0.1.schema.json#/definitions/mapping_definition_base"
8
    }, {
9
	"$ref": "./common_definitions-1.0.1.schema.json#/definitions/item_definition"
10
    }, {
11
	"type": "object",
12
	"required": ["$schema"],
13
	"properties": {
14
	    "$schema": {
15
		"description": "Mark this instance as conforming to mapping description schema 1.x",
16
		"type": "string",
17
		"pattern": "^https://hydrilla\\.koszko\\.org/schemas/api_mapping_description-1\\.(([1-9][0-9]*|0)\\.)*schema\\.json$"
18
	    }
19
	}
20
    }]
21
}
api_mapping_description-1.0.1.schema.json.license
1
SPDX-License-Identifier: CC0-1.0
2

  
3
Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
4

  
5
Available under the terms of Creative Commons Zero v1.0 Universal.
api_mapping_description-1.schema.json
1
{
2
    "$schema": "http://json-schema.org/draft-07/schema#",
3
    "$id": "https://hydrilla.koszko.org/schemas/api_mapping_description-1.schema.json",
4
    "title": "Mapping description",
5
    "description": "Definition of a Hydrilla mapping, as served through HTTP API",
6
    "allOf": [{
7
	"$ref": "./common_definitions-1.schema.json#/definitions/mapping_definition_base"
8
    }, {
9
	"$ref": "./common_definitions-1.schema.json#/definitions/item_definition"
10
    }, {
11
	"type": "object",
12
	"required": ["$schema"],
13
	"properties": {
14
	    "$schema": {
15
		"description": "Mark this instance as conforming to mapping description schema 1.x",
16
		"type": "string",
17
		"pattern": "^https://hydrilla\\.koszko\\.org/schemas/api_mapping_description-1\\.([1-9][0-9]*\\.)*schema\\.json$"
18
	    }
19
	}
20
    }]
21
}
api_mapping_description-1.schema.json.license
1
SPDX-License-Identifier: CC0-1.0
2

  
3
Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
4

  
5
Available under the terms of Creative Commons Zero v1.0 Universal.
api_query_result-1.0.1.schema.json
1
{
2
    "$schema": "http://json-schema.org/draft-07/schema#",
3
    "$id": "https://hydrilla.koszko.org/schemas/api_query_result-1.0.1.schema.json",
4
    "title": "Query result",
5
    "description": "Object with a list of references to mappings that contain payloads for requested URL",
6
    "type": "object",
7
    "required": ["$schema", "mappings"],
8
    "properties": {
9
	"$schema": {
10
	    "description": "Mark this instance as conforming to query result schema 1.x",
11
	    "type": "string",
12
	    "pattern": "^https://hydrilla\\.koszko\\.org/schemas/api_query_result-1\\.(([1-9][0-9]*|0)\\.)*schema\\.json$"
13
	},
14
	"mappings": {
15
	    "description": "References to mappings using at least one pattern that matches the requested URL",
16
	    "type": "array",
17
	    "items": {
18
		"$ref": "./common_definitions-1.0.1.schema.json#/definitions/item_ref"
19
	    }
20
	},
21
	"generated_by": {
22
	    "$ref": "./common_definitions-1.0.1.schema.json#/definitions/generated_by"
23
	}
24
    }
25
}
api_query_result-1.0.1.schema.json.license
1
SPDX-License-Identifier: CC0-1.0
2

  
3
Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
4

  
5
Available under the terms of Creative Commons Zero v1.0 Universal.
api_query_result-1.schema.json
1
{
2
    "$schema": "http://json-schema.org/draft-07/schema#",
3
    "$id": "https://hydrilla.koszko.org/schemas/api_query_result-1.schema.json",
4
    "title": "Query result",
5
    "description": "Object with a list of references to mappings that contain payloads for requested URL",
6
    "type": "object",
7
    "required": ["$schema", "mappings"],
8
    "properties": {
9
	"$schema": {
10
	    "description": "Mark this instance as conforming to query result schema 1.x",
11
	    "type": "string",
12
	    "pattern": "^https://hydrilla\\.koszko\\.org/schemas/api_query_result-1\\.([1-9][0-9]*\\.)*schema\\.json$"
13
	},
14
	"mappings": {
15
	    "description": "References to mappings using at least one pattern that matches the requested URL",
16
	    "type": "array",
17
	    "items": {
18
		"$ref": "./common_definitions-1.schema.json#/definitions/item_ref"
19
	    }
20
	},
21
	"generated_by": {
22
	    "$ref": "./common_definitions-1.schema.json#/definitions/generated_by"
23
	}
24
    }
25
}
api_query_result-1.schema.json.license
1
SPDX-License-Identifier: CC0-1.0
2

  
3
Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
4

  
5
Available under the terms of Creative Commons Zero v1.0 Universal.
api_resource_description-1.0.1.schema.json
1
{
2
    "$schema": "http://json-schema.org/draft-07/schema#",
3
    "$id": "https://hydrilla.koszko.org/schemas/api_resource_description-1.0.1.schema.json",
4
    "title": "Resource description",
5
    "description": "Definition of a Hydrilla resource, as served through HTTP API",
6
    "allOf": [{
7
	"$ref": "./common_definitions-1.0.1.schema.json#/definitions/resource_definition_base"
8
    }, {
9
	"$ref": "./common_definitions-1.0.1.schema.json#/definitions/item_definition"
10
    }, {
11
	"type": "object",
12
	"required": ["$schema"],
13
	"properties": {
14
	    "$schema": {
15
		"description": "Mark this instance as conforming to resource description schema 1.x",
16
		"type": "string",
17
		"pattern": "^https://hydrilla\\.koszko\\.org/schemas/api_resource_description-1\\.(([1-9][0-9]*|0)\\.)*schema\\.json$"
18
	    },
19
	    "scripts": {
20
		"description": "Which files are resource's scripts and need to be installed",
21
		"$ref": "./common_definitions-1.0.1.schema.json#/definitions/file_ref_list_sha256",
22
		"default": []
23
	    }
24
	}
25
    }]
26
}
api_resource_description-1.0.1.schema.json.license
1
SPDX-License-Identifier: CC0-1.0
2

  
3
Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
4

  
5
Available under the terms of Creative Commons Zero v1.0 Universal.
api_resource_description-1.schema.json
1
{
2
    "$schema": "http://json-schema.org/draft-07/schema#",
3
    "$id": "https://hydrilla.koszko.org/schemas/api_resource_description-1.schema.json",
4
    "title": "Resource description",
5
    "description": "Definition of a Hydrilla resource, as served through HTTP API",
6
    "allOf": [{
7
	"$ref": "./common_definitions-1.schema.json#/definitions/resource_definition_base"
8
    }, {
9
	"$ref": "./common_definitions-1.schema.json#/definitions/item_definition"
10
    }, {
11
	"type": "object",
12
	"required": ["$schema"],
13
	"properties": {
14
	    "$schema": {
15
		"description": "Mark this instance as conforming to resource description schema 1.x",
16
		"type": "string",
17
		"pattern": "^https://hydrilla\\.koszko\\.org/schemas/api_resource_description-1\\.([1-9][0-9]*\\.)*schema\\.json$"
18
	    },
19
	    "scripts": {
20
		"description": "Which files are resource's scripts and need to be installed",
21
		"$ref": "./common_definitions-1.schema.json#/definitions/file_ref_list_sha256",
22
		"default": []
23
	    }
24
	}
25
    }]
26
}
api_resource_description-1.schema.json.license
1
SPDX-License-Identifier: CC0-1.0
2

  
3
Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
4

  
5
Available under the terms of Creative Commons Zero v1.0 Universal.
api_source_description-1.0.1.schema.json
1
{
2
    "$schema": "http://json-schema.org/draft-07/schema#",
3
    "$id": "https://hydrilla.koszko.org/schemas/api_source_description-1.0.1.schema.json",
4
    "title": "Source description",
5
    "description": "Built description of a Hydrilla source package",
6
    "type": "object",
7
    "required": [
8
	"$schema",
9
	"source_name",
10
	"source_copyright",
11
	"source_archives",
12
	"upstream_url",
13
	"definitions"
14
    ],
15
    "properties": {
16
	"$schema": {
17
	    "description": "Mark this instance as conforming to source description schema 1.x",
18
	    "type": "string",
19
	    "pattern": "^https://hydrilla\\.koszko\\.org/schemas/api_source_description-1\\.(([1-9][0-9]*|0)\\.)*schema\\.json$"
20
	},
21
	"source_name": {
22
	    "$ref": "./common_definitions-1.0.1.schema.json#/definitions/source_name"
23
	},
24
	"source_copyright":  {
25
	    "description": "Which files indicate license terms of the source package",
26
	    "$ref": "./common_definitions-1.0.1.schema.json#/definitions/file_ref_list_sha256"
27
	},
28
	"source_archives": {
29
	    "description": "What archive extensions are available for this package's sources",
30
	    "type": "object",
31
	    "required": ["zip"],
32
	    "additionalProperties": {
33
		"description": "What is the SHA256 sum of given source archive",
34
		"type": "object",
35
		"required": ["sha256"],
36
		"properties": {
37
		    "sha256": {
38
			"$ref": "./common_definitions-1.0.1.schema.json#/definitions/sha256"
39
		    }
40
		}
41
	    },
42
	    "examples": [{
43
		"zip": {
44
		    "sha256": "688461da362ffe2fc8e85db73e709a5356d41c8aeb7d1eee7170c64ee21dd2a2"
45
		}
46
	    }]
47
	},
48
	"upstream_url": {
49
	    "description": "Where this software/work initially comes from",
50
	    "type": "string"
51
	},
52
	"comment": {
53
	    "$ref": "./common_definitions-1.0.1.schema.json#/definitions/comment"
54
	},
55
	"definitions": {
56
	    "description": "References to site resources and pattern->payload mappings",
57
	    "type": "array",
58
	    "items": {
59
		"$ref": "./common_definitions-1.0.1.schema.json#/definitions/typed_item_ref"
60
	    }
61
	},
62
	"generated_by": {
63
	    "$ref": "./common_definitions-1.0.1.schema.json#/definitions/generated_by"
64
	}
65
    }
66
}
api_source_description-1.0.1.schema.json.license
1
SPDX-License-Identifier: CC0-1.0
2

  
3
Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
4

  
5
Available under the terms of Creative Commons Zero v1.0 Universal.
api_source_description-1.schema.json
1
{
2
    "$schema": "http://json-schema.org/draft-07/schema#",
3
    "$id": "https://hydrilla.koszko.org/schemas/api_source_description-1.schema.json",
4
    "title": "Source description",
5
    "description": "Built description of a Hydrilla source package",
6
    "type": "object",
7
    "required": [
8
	"$schema",
9
	"source_name",
10
	"source_copyright",
11
	"source_archives",
12
	"upstream_url",
13
	"definitions"
14
    ],
15
    "properties": {
16
	"$schema": {
17
	    "description": "Mark this instance as conforming to source description schema 1.x",
18
	    "type": "string",
19
	    "pattern": "^https://hydrilla\\.koszko\\.org/schemas/api_source_description-1\\.([1-9][0-9]*\\.)*schema\\.json$"
20
	},
21
	"source_name": {
22
	    "$ref": "./common_definitions-1.schema.json#/definitions/source_name"
23
	},
24
	"source_copyright":  {
25
	    "description": "Which files indicate license terms of the source package",
26
	    "$ref": "./common_definitions-1.schema.json#/definitions/file_ref_list_sha256"
27
	},
28
	"source_archives": {
29
	    "description": "What archive extensions are available for this package's sources",
30
	    "type": "object",
31
	    "required": ["zip"],
32
	    "additionalProperties": {
33
		"description": "What is the SHA256 sum of given source archive",
34
		"type": "object",
35
		"required": ["sha256"],
36
		"properties": {
37
		    "sha256": {
38
			"$ref": "./common_definitions-1.schema.json#/definitions/sha256"
39
		    }
40
		}
41
	    },
42
	    "examples": [{
43
		"zip": {
44
		    "sha256": "688461da362ffe2fc8e85db73e709a5356d41c8aeb7d1eee7170c64ee21dd2a2"
45
		}
46
	    }]
47
	},
48
	"upstream_url": {
49
	    "description": "Where this software/work initially comes from",
50
	    "type": "string"
51
	},
52
	"comment": {
53
	    "$ref": "./common_definitions-1.schema.json#/definitions/comment"
54
	},
55
	"definitions": {
56
	    "description": "References to site resources and pattern->payload mappings",
57
	    "type": "array",
58
	    "items": {
59
		"$ref": "./common_definitions-1.schema.json#/definitions/typed_item_ref"
60
	    }
61
	},
62
	"generated_by": {
63
	    "$ref": "./common_definitions-1.schema.json#/definitions/generated_by"
64
	}
65
    }
66
}
api_source_description-1.schema.json.license
1
SPDX-License-Identifier: CC0-1.0
2

  
3
Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
4

  
5
Available under the terms of Creative Commons Zero v1.0 Universal.
common_definitions-1.0.1.schema.json
1
{
2
    "$schema": "http://json-schema.org/draft-07/schema#",
3
    "$id": "https://hydrilla.koszko.org/schemas/common_definitions-1.0.1.schema.json",
4
    "title": "Common definitions",
5
    "description": "Definitions used by other Hydrilla schemas",
6
    "definitions": {
7
	"version": {
8
	    "description": "Version expressed as an array of integers",
9
	    "type": "array",
10
	    "minItems": 1,
11
	    "items": {
12
		"type": "integer",
13
		"minimum": 0
14
	    },
15
	    "contains": {
16
		"type": "integer",
17
		"minimum": 1
18
	    },
19
	    "minItems": 1
20
	},
21
	"source_name": {
22
	    "description": "Unique identifier of this source package",
23
	    "type": "string",
24
	    "pattern": "^[-0-9a-z.]+$"
25
	},
26
	"comment": {
27
	    "description": "An optional comment",
28
	    "type": "string"
29
	},
30
        "file_ref_list": {
31
	    "description": "List of simple file references",
32
	    "type": "array",
33
	    "items": {
34
		"type": "object",
35
		"required": ["file"],
36
		"properties": {
37
		    "file": {
38
			"description": "Filename relative to source package main directory; separator is '/'",
39
			"type": "string",
40
			"pattern": "^[^/]"
41
		    }
42
		}
43
	    }
44
        },
45
	"sha256": {
46
	    "description": "An SHA256 sum, in hexadecimal",
47
	    "type": "string",
48
	    "pattern": "^[0-9a-f]{64}$"
49
	},
50
        "file_ref_list_sha256": {
51
	    "description": "List of file references with files' SHA256 sums included",
52
	    "allOf": [{
53
		"$ref": "#/definitions/file_ref_list"
54
	    }, {
55
		"type": "array",
56
		"items": {
57
		    "type": "object",
58
		    "required": ["sha256"],
59
		    "properties": {
60
			"sha256": {
61
			    "$ref": "#/definitions/sha256"
62
			}
63
		    }
64
		}
65
	    }]
66
        },
67
	"item_identifier": {
68
	    "description": "Identifier of an item (shared with other versions of the item, otherwise unique)",
69
	    "type": "string",
70
	    "pattern": "^[-0-9a-z]+$"
71
	},
72
	"item_dep_specifier": {
73
	    "description": "Simple reference to an item as a dependency",
74
	    "type": "object",
75
	    "required": ["identifier"],
76
	    "properties": {
77
		"identifier": {
78
		    "$ref": "#/definitions/item_identifier"
79
		}
80
	    }
81
	},
82
	"item_ref": {
83
	    "description": "An object containing a subset of fields from full item definition",
84
	    "type": "object",
85
	    "required": ["identifier", "long_name", "version"],
86
	    "properties": {
87
		"identifier": {
88
		    "$ref": "#/definitions/item_identifier"
89
		},
90
		"long_name": {
91
		    "description": "User-friendly alternative to the identifier",
92
		    "type": "string"
93
		},
94
		"version": {
95
		    "$ref": "#/definitions/version"
96
		}
97
	    }
98
	},
99
	"typed_item_ref": {
100
	    "description": "An object containing a subset of fields from full item definition, including type",
101
	    "allOf": [{
102
		"$ref": "#/definitions/item_ref"
103
	    }, {
104
		"type": "object",
105
		"required": ["type"],
106
		"properties": {
107
		    "type": {
108
			"description": "What kind of item is it (resource or mapping)",
109
			"enum": ["resource", "mapping"]
110
		    }
111
		}
112
	    }]
113
	},
114
	"item_definition_base": {
115
	    "description": "Definition of a resource/mapping (fields common to source definitions and built definitions)",
116
	    "allOf": [{
117
		"$ref": "#/definitions/typed_item_ref"
118
	    }, {
119
		"type": "object",
120
		"required": ["description"],
121
		"properties": {
122
		    "uuid": {
123
			"description": "UUIDv4 of this item (shared with other versions of this item, otherwise unique)",
124
			"type": "string",
125
			"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
126
		    },
127
		    "description": {
128
			"description": "Item's description",
129
			"type": "string"
130
		    },
131
		    "comment": {
132
			"$ref": "#/definitions/comment"
133
		    }
134
		}
135
	    }]
136
	},
137
	"resource_definition_base": {
138
	    "description": "Definition of a resource (fields common to source definitions and built definitions)",
139
	    "allOf": [{
140
		"$ref": "#/definitions/item_definition_base"
141
	    }, {
142
		"type": "object",
143
		"required": ["type", "revision"],
144
		"properties": {
145
		    "type": {
146
			"description": "Identify this item as a resource",
147
			"const": "resource"
148
		    },
149
		    "revision": {
150
			"description": "Which revision of a packaging of given version of an upstream resource is this",
151
			"type": "integer",
152
			"minimum": 1
153
		    },
154
		    "scripts": {
155
			"description": "What scripts are included in the resource",
156
			"$ref": "#/definitions/file_ref_list",
157
			"default": []
158
		    },
159
		    "dependencies": {
160
			"description": "Which other resources this resource depends on",
161
			"type": "array",
162
			"items": {
163
			    "$ref": "#/definitions/item_dep_specifier"
164
			},
165
			"default": []
166
		    }
167
		}
168
	    }]
169
	},
170
	"mapping_definition_base": {
171
	    "description": "Definition of a mapping (fields common to source definitions and built definitions)",
172
	    "allOf": [{
173
		"$ref": "#/definitions/item_definition_base"
174
	    }, {
175
		"type": "object",
176
		"required": ["type"],
177
		"properties": {
178
		    "type": {
179
			"description": "Identify this item as a mapping",
180
			"const": "mapping"
181
		    },
182
		    "payloads": {
183
			"description": "Which payloads are to be applied to which URLs",
184
			"additionalProperties": {
185
			    "$ref": "#/definitions/item_dep_specifier"
186
			},
187
			"default": {},
188
			"examples": [{
189
			    "https://hydrillabugs.koszko.org/***": {
190
				"identifier": "helloapple"
191
			    },
192
			    "https://*.koszko.org/***": {
193
				"identifier": "hello-potato"
194
			    }
195
			}]
196
		    }
197
		}
198
	    }]
199
	},
200
	"generated_by": {
201
	    "description": "Describe what software generated this instance",
202
	    "type": "object",
203
	    "required": ["name"],
204
	    "properties": {
205
		"name": {
206
		    "type": "string",
207
		    "description": "Instance generator software name, without version"
208
		},
209
		"version": {
210
		    "type": "string",
211
		    "description": "Instance generator software version, in arbitrary format"
212
		}
213
	    }
214
	},
215
	"item_definition": {
216
	    "description": "Definition of a resource/mapping (fields specific to built definitions)",
217
	    "type": "object",
218
	    "required": ["source_name", "source_copyright"],
219
	    "properties": {
220
		"source_name": {
221
		    "$ref": "#/definitions/source_name"
222
		},
223
		"source_copyright": {
224
		    "description": "Which files indicate license terms of the source package and should be installed",
225
		    "$ref": "#/definitions/file_ref_list_sha256"
226
		},
227
		"generated_by": {
228
		    "$ref": "#/definitions/generated_by"
229
		}
230
	    }
231
	}
232
    }
233
}
common_definitions-1.0.1.schema.json.license
1
SPDX-License-Identifier: CC0-1.0
2

  
3
Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
4

  
5
Available under the terms of Creative Commons Zero v1.0 Universal.
common_definitions-1.schema.json
1
{
2
    "$schema": "http://json-schema.org/draft-07/schema#",
3
    "$id": "https://hydrilla.koszko.org/schemas/common_definitions-1.schema.json",
4
    "title": "Common definitions",
5
    "description": "Definitions used by other Hydrilla schemas",
6
    "definitions": {
7
	"version": {
8
	    "description": "Version expressed as an array of integers",
9
	    "type": "array",
10
	    "minItems": 1,
11
	    "items": {
12
		"type": "integer",
13
		"minimum": 0
14
	    },
15
	    "contains": {
16
		"type": "integer",
17
		"minimum": 1
18
	    },
19
	    "minItems": 1
20
	},
21
	"source_name": {
22
	    "description": "Unique identifier of this source package",
23
	    "type": "string",
24
	    "pattern": "^[-0-9a-z.]+$"
25
	},
26
	"comment": {
27
	    "description": "An optional comment",
28
	    "type": "string"
29
	},
30
        "file_ref_list": {
31
	    "description": "List of simple file references",
32
	    "type": "array",
33
	    "items": {
34
		"type": "object",
35
		"required": ["file"],
36
		"properties": {
37
		    "file": {
38
			"description": "Filename relative to source package main directory; separator is '/'",
39
			"type": "string",
40
			"pattern": "^[^/]"
41
		    }
42
		}
43
	    }
44
        },
45
	"sha256": {
46
	    "description": "An SHA256 sum, in hexadecimal",
47
	    "type": "string",
48
	    "pattern": "^[0-9a-f]{64}$"
49
	},
50
        "file_ref_list_sha256": {
51
	    "description": "List of file references with files' SHA256 sums included",
52
	    "allOf": [{
53
		"$ref": "#/definitions/file_ref_list"
54
	    }, {
55
		"type": "array",
56
		"items": {
57
		    "type": "object",
58
		    "required": ["sha256"],
59
		    "properties": {
60
			"sha256": {
61
			    "$ref": "#/definitions/sha256"
62
			}
63
		    }
64
		}
65
	    }]
66
        },
67
	"item_identifier": {
68
	    "description": "Identifier of an item (shared with other versions of the item, otherwise unique)",
69
	    "type": "string",
70
	    "pattern": "^[-0-9a-z]+$"
71
	},
72
	"item_dep_specifier": {
73
	    "description": "Simple reference to an item as a dependency",
74
	    "type": "object",
75
	    "required": ["identifier"],
76
	    "properties": {
77
		"identifier": {
78
		    "$ref": "#/definitions/item_identifier"
79
		}
80
	    }
81
	},
82
	"item_ref": {
83
	    "description": "An object containing a subset of fields from full item definition",
84
	    "type": "object",
85
	    "required": ["identifier", "long_name", "version"],
86
	    "properties": {
87
		"identifier": {
88
		    "$ref": "#/definitions/item_identifier"
89
		},
90
		"long_name": {
91
		    "description": "User-friendly alternative to the identifier",
92
		    "type": "string"
93
		},
94
		"version": {
95
		    "$ref": "#definitions/version"
96
		}
97
	    }
98
	},
99
	"typed_item_ref": {
100
	    "description": "An object containing a subset of fields from full item definition, including type",
101
	    "allOf": [{
102
		"$ref": "#/definitions/item_ref"
103
	    }, {
104
		"type": "object",
105
		"required": ["type"],
106
		"properties": {
107
		    "type": {
108
			"description": "What kind of item is it (resource or mapping)",
109
			"enum": ["resource", "mapping"]
110
		    }
111
		}
112
	    }]
113
	},
114
	"item_definition_base": {
115
	    "description": "Definition of a resource/mapping (fields common to source definitions and built definitions)",
116
	    "allOf": [{
117
		"$ref": "#/definitions/typed_item_ref"
118
	    }, {
119
		"type": "object",
120
		"required": ["description"],
121
		"properties": {
122
		    "uuid": {
123
			"description": "UUIDv4 of this item (shared with other versions of this item, otherwise unique)",
124
			"type": "string",
125
			"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
126
		    },
127
		    "description": {
128
			"description": "Item's description",
129
			"type": "string"
130
		    },
131
		    "comment": {
132
			"$ref": "#/definitions/comment"
133
		    }
134
		}
135
	    }]
136
	},
137
	"resource_definition_base": {
138
	    "description": "Definition of a resource (fields common to source definitions and built definitions)",
139
	    "allOf": [{
140
		"$ref": "#/definitions/item_definition_base"
141
	    }, {
142
		"type": "object",
143
		"required": ["type", "revision"],
144
		"properties": {
145
		    "type": {
146
			"description": "Identify this item as a resource",
147
			"const": "resource"
148
		    },
149
		    "revision": {
150
			"description": "Which revision of a packaging of given version of an upstream resource is this",
151
			"type": "integer",
152
			"minimum": 1
153
		    },
154
		    "scripts": {
155
			"description": "What scripts are included in the resource",
156
			"$ref": "#/definitions/file_ref_list",
157
			"default": []
158
		    },
159
		    "dependencies": {
160
			"description": "Which other resources this resource depends on",
161
			"type": "array",
162
			"items": {
163
			    "$ref": "#/definitions/item_dep_specifier"
164
			},
165
			"default": []
166
		    }
167
		}
168
	    }]
169
	},
170
	"mapping_definition_base": {
171
	    "description": "Definition of a mapping (fields common to source definitions and built definitions)",
172
	    "allOf": [{
173
		"$ref": "#/definitions/item_definition_base"
174
	    }, {
175
		"type": "object",
176
		"required": ["type"],
177
		"properties": {
178
		    "type": {
179
			"description": "Identify this item as a mapping",
180
			"const": "mapping"
181
		    },
182
		    "payloads": {
183
			"description": "Which payloads are to be applied to which URLs",
184
			"additionalProperties": {
185
			    "$ref": "#/definitions/item_dep_specifier"
186
			},
187
			"default": {},
188
			"examples": [{
189
			    "https://hydrillabugs.koszko.org/***": {
190
				"identifier": "helloapple"
191
			    },
192
			    "https://*.koszko.org/***": {
193
				"identifier": "hello-potato"
194
			    }
195
			}]
196
		    }
197
		}
198
	    }]
199
	},
200
	"generated_by": {
201
	    "description": "Describe what software generated this instance",
202
	    "type": "object",
203
	    "required": ["name"],
204
	    "properties": {
205
		"name": {
206
		    "type": "string",
207
		    "description": "Instance generator software name, without version"
208
		},
209
		"version": {
210
		    "type": "string",
211
		    "description": "Instance generator software version, in arbitrary format"
212
		}
213
	    }
214
	},
215
	"item_definition": {
216
	    "description": "Definition of a resource/mapping (fields specific to built definitions)",
217
	    "type": "object",
218
	    "required": ["source_name", "source_copyright"],
219
	    "properties": {
220
		"source_name": {
221
		    "$ref": "#/definitions/source_name"
222
		},
223
		"source_copyright": {
224
		    "description": "Which files indicate license terms of the source package and should be installed",
225
		    "$ref": "#/definitions/file_ref_list_sha256"
226
		},
227
		"generated_by": {
228
		    "$ref": "#/definitions/generated_by"
229
		}
230
	    }
231
	}
232
    }
233
}
common_definitions-1.schema.json.license
1
SPDX-License-Identifier: CC0-1.0
2

  
3
Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
4

  
5
Available under the terms of Creative Commons Zero v1.0 Universal.
package_source-1.0.1.schema.json
1
{
2
    "$schema": "http://json-schema.org/draft-07/schema#",
3
    "$id": "https://hydrilla.koszko.org/schemas/package_source-1.0.1.schema.json",
4
    "title": "Package source",
5
    "description": "Definition of a Hydrilla source package",
6
    "type": "object",
7
    "required": [
8
	"$schema",
9
	"source_name",
10
	"copyright",
11
	"upstream_url",
12
	"definitions"
13
    ],
14
    "properties": {
15
	"$schema": {
16
	    "description": "Mark this instance as conforming to package source schema 1.x",
17
	    "type": "string",
18
	    "pattern": "^https://hydrilla\\.koszko\\.org/schemas/package_source-1\\.(([1-9][0-9]*|0)\\.)*schema\\.json$"
19
	},
20
	"source_name": {
21
	    "$ref": "./common_definitions-1.0.1.schema.json#/definitions/source_name"
22
	},
23
	"copyright":  {
24
	    "description": "Which files from the source package indicate its license terms and should be included in the distribution packages",
25
	    "$ref": "./common_definitions-1.0.1.schema.json#/definitions/file_ref_list"
26
	},
27
	"upstream_url": {
28
	    "description": "Where this software/work initially comes from",
29
	    "type": "string"
30
	},
31
	"comment": {
32
	    "$ref": "./common_definitions-1.0.1.schema.json#/definitions/comment"
33
	},
34
	"definitions": {
35
	    "description": "Definitions of site resources and pattern->payload mappings",
36
	    "type": "array",
37
	    "items": {
38
		"anyOf": [{
39
		    "$ref": "./common_definitions-1.0.1.schema.json#/definitions/resource_definition_base"
40
		}, {
41
		    "$ref": "./common_definitions-1.0.1.schema.json#/definitions/mapping_definition_base"
42
		}]
43
	    }
44
	},
45
	"additional_files": {
46
	    "description": "Files which should be included in the source archive produced by Hydrilla builder in addition to script and copyright files",
47
	    "$ref": "./common_definitions-1.0.1.schema.json#/definitions/file_ref_list",
48
	    "default": []
49
	},
50
	"reuse_generate_spdx_report": {
51
	    "description": "Should report.spdx be automatically generated for the package using REUSE tool",
52
	    "type": "boolean",
53
	    "default": false
54
	}
55
    }
56
}
package_source-1.0.1.schema.json.license
1
SPDX-License-Identifier: CC0-1.0
2

  
3
Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
4

  
5
Available under the terms of Creative Commons Zero v1.0 Universal.
package_source-1.schema.json
1
{
2
    "$schema": "http://json-schema.org/draft-07/schema#",
3
    "$id": "https://hydrilla.koszko.org/schemas/package_source-1.schema.json",
4
    "title": "Package source",
5
    "description": "Definition of a Hydrilla source package",
6
    "type": "object",
7
    "required": [
8
	"$schema",
9
	"source_name",
10
	"copyright",
11
	"upstream_url",
12
	"definitions"
13
    ],
14
    "properties": {
15
	"$schema": {
16
	    "description": "Mark this instance as conforming to package source schema 1.x",
17
	    "type": "string",
18
	    "pattern": "^https://hydrilla\\.koszko\\.org/schemas/package_source-1\\.([1-9][0-9]*\\.)*schema\\.json$"
19
	},
20
	"source_name": {
21
	    "$ref": "./common_definitions-1.schema.json#/definitions/source_name"
22
	},
23
	"copyright":  {
24
	    "description": "Which files from the source package indicate its license terms and should be included in the distribution packages",
25
	    "$ref": "./common_definitions-1.schema.json#/definitions/file_ref_list"
26
	},
27
	"upstream_url": {
28
	    "description": "Where this software/work initially comes from",
29
	    "type": "string"
30
	},
31
	"comment": {
32
	    "$ref": "./common_definitions-1.schema.json#/definitions/comment"
33
	},
34
	"definitions": {
35
	    "description": "Definitions of site resources and pattern->payload mappings",
36
	    "type": "array",
37
	    "items": {
38
		"anyOf": [{
39
		    "$ref": "./common_definitions-1.schema.json#/definitions/resource_definition_base"
40
		}, {
41
		    "$ref": "./common_definitions-1.schema.json#/definitions/mapping_definition_base"
42
		}]
43
	    }
44
	},
45
	"additional_files": {
46
	    "description": "Files which should be included in the source archive produced by Hydrilla builder in addition to script and copyright files",
47
	    "$ref": "./common_definitions-1.schema.json#/definitions/file_ref_list",
48
	    "default": []
49
	},
50
	"reuse_generate_spdx_report": {
51
	    "description": "Should report.spdx be automatically generated for the package using REUSE tool",
52
	    "type": "boolean",
53
	    "default": false
54
	}
55
    }
56
}
package_source-1.schema.json.license
1
SPDX-License-Identifier: CC0-1.0
2

  
3
Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
4

  
5
Available under the terms of Creative Commons Zero v1.0 Universal.

Also available in: Unified diff