Project

General

Profile

« Previous | Next » 

Revision 7206db45

Added by koszko over 1 year ago

move all schema files to 2.x version series

This commit also introduces:

  • combined source definitions of resource and mapping,
  • dependencies on mappings,
  • permissions,
  • Haketilo version constraints.

View differences:

package_source-2.schema.json
3 3
    "$id": "https://hydrilla.koszko.org/schemas/package_source-2.schema.json",
4 4
    "title": "Package source",
5 5
    "description": "Definition of a Hydrilla source package",
6
    "allOf": [{
7
	"description": "Definition of a Hydrilla source package - validation rules common for all minor schema versions",
8
	"type": "object",
9
	"required": [
10
	    "$schema",
11
	    "source_name",
12
	    "copyright",
13
	    "upstream_url",
14
	    "definitions"
15
	],
16
	"properties": {
17
	    "$schema": {
18
		"description": "Mark this instance as conforming to package source schema 1.x or 2.x",
19
		"type": "string",
20
		"pattern": "^https://hydrilla\\.koszko\\.org/schemas/package_source-[12]\\.(([1-9][0-9]*|0)\\.)*schema\\.json$"
21
	    },
22
	    "source_name": {
23
		"$ref": "./common_definitions-1.0.1.schema.json#/definitions/source_name"
24
	    },
25
	    "copyright":  {
26
		"description": "Which files from the source package indicate its license terms and should be included in the distribution packages",
27
		"$ref": "./common_definitions-1.0.1.schema.json#/definitions/file_ref_list"
28
	    },
29
	    "upstream_url": {
30
		"description": "Where this software/work initially comes from",
31
		"type": "string"
32
	    },
33
	    "comment": {
34
		"$ref": "./common_definitions-1.0.1.schema.json#/definitions/comment"
35
	    },
36
	    "definitions": {
37
		"description": "Definitions of site resources and pattern->payload mappings",
38
		"type": "array",
39
		"items": {
40
		    "anyOf": [{
41
			"$ref": "./common_definitions-1.0.1.schema.json#/definitions/resource_definition_base"
42
		    }, {
43
			"$ref": "./common_definitions-1.0.1.schema.json#/definitions/mapping_definition_base"
44
		    }]
45
		}
46
	    },
47
	    "additional_files": {
48
		"description": "Files which should be included in the source archive produced by Hydrilla builder in addition to script and copyright files",
49
		"$ref": "./common_definitions-1.0.1.schema.json#/definitions/file_ref_list",
50
		"default": []
51
	    },
52
	    "reuse_generate_spdx_report": {
53
		"description": "Should report.spdx be automatically generated for the package using REUSE tool",
54
		"type": "boolean",
55
		"default": false
56
	    }
57
	}
58
    }, {
59
	"description": "Definition of a Hydrilla source package - validation rules common for versions 2 and higher",
60
	"if": {
61
	    "type": "object",
62
	    "properties": {
63
		"$schema": {
64
		    "description": "Select instances that specify schema version 1.0.x",
65
		    "type": "string",
66
		    "pattern": "^https://hydrilla\\.koszko\\.org/schemas/package_source-2\\..*schema\\.json$"
67
		}
68
	    }
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 2.x",
17
	    "type": "string",
18
	    "pattern": "^https://hydrilla\\.koszko\\.org/schemas/package_source-2\\.(([1-9][0-9]*|0)\\.)*schema\\.json$"
69 19
	},
70
	"else": {
71
	    "description": "Validate the piggybacking correctness",
72
	    "type": "object",
73
	    "properties": {
74
		"piggyback_on": {
75
		    "anyOf": [{
76
			"$ref": "#/definitions/piggyback_apt"
77
		    }]
78
		}
20
	"source_name": {
21
	    "$ref": "./common_definitions-2.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-2.schema.json#/definitions/file_ref_list"
26
	},
27
	"upstream_url": {
28
	    "description": "Where this software/work initially comes from",
29
	    "type": "string"
30
	},
31
	"piggyback_on": {
32
	    "description": "Specify packages from other software system that should be used for constructing this package",
33
	    "anyOf": [{
34
		"$ref": "#/definitions/piggyback_apt"
35
	    }]
36
	},
37
	"comment": {
38
	    "$ref": "./common_definitions-2.schema.json#/definitions/comment"
39
	},
40
	"definitions": {
41
	    "description": "Definitions of site resources and pattern->payload mappings (possibly combined together)",
42
	    "type": "array",
43
	    "items": {
44
		"$ref": "#/definitions/item_definition"
79 45
	    }
46
	},
47
	"additional_files": {
48
	    "description": "Files which should be included in the source archive produced by Hydrilla builder in addition to script and copyright files",
49
	    "$ref": "./common_definitions-2.schema.json#/definitions/file_ref_list",
50
	    "default": []
51
	},
52
	"reuse_generate_spdx_report": {
53
	    "description": "Should report.spdx be automatically generated for the package using REUSE tool",
54
	    "type": "boolean",
55
	    "default": false
80 56
	}
81
    }],
57
    },
82 58
    "definitions": {
83 59
	"piggyback_apt": {
84 60
	    "description": "Specify packages from APT software system that should be used for constructing this package",
......
136 112
		    "default": true
137 113
		}
138 114
	    }
115
	},
116
	"item_definition": {
117
	    "description": "Definition of either a site resource, a pattern->payload mapping or both combined together",
118
	    "if": {
119
		"type": "object",
120
		"required": ["type"],
121
		"properties": {
122
		    "type": {
123
			"const": "resource"
124
		    }
125
		}
126
	    },
127
	    "then": {
128
		"$ref": "./common_definitions-2.schema.json#/definitions/resource_definition_base"
129
	    },
130
	    "else": {
131
		"if": {
132
		    "type": "object",
133
		    "required": ["type"],
134
		    "properties": {
135
			"type": {
136
			    "const": "mapping"
137
			}
138
		    }
139
		},
140
		"then": {
141
		    "$ref": "./common_definitions-2.schema.json#/definitions/mapping_definition_base"
142
		},
143
		"else": {
144
		    "allOf": [{
145
			"type": "object",
146
			"required": ["type"],
147
			"properties": {
148
			    "type": {
149
				"const": "mapping_and_resource"
150
			    }
151
			}
152
		    }, {
153
			"$ref": "#/definitions/combined_mapping_resource_definition"
154
		    }]
155
		}
156
	    }
157
	},
158
	"combined_mapping_resource_definition": {
159
	    "allOf": [{
160
		"$ref": "./common_definitions-2.schema.json#/definitions/mapping_definition_base"
161
	    }, {
162
		"$ref": "./common_definitions-2.schema.json#/definitions/resource_definition_base"
163
	    }]
139 164
	}
140 165
    }
141 166
}

Also available in: Unified diff