This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
/
json_schema.py
72 lines (72 loc) · 3.23 KB
/
json_schema.py
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
SCHEMA = '''{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MigrationPlan",
"type": "object",
"properties": {
"plugins": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"protection": {
"type": "boolean"
},
"repositories": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"pulp2_importer_repository_id": {
"type": "string"
},
"repository_versions": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"pulp2_repository_id": {
"type": "string"
},
"distributor_ids": {
"type": "array"
},
"protection": {
"type": "array"
}
},
"required": ["pulp2_repository_id"],
"additionalProperties": false,
"$comment": "if protection field is present then distributor_ids field should be present",
"dependencies": {
"protection": ["distributor_ids"]
}
}
}
},
"required": ["name", "pulp2_importer_repository_id", "repository_versions"],
"additionalProperties": false,
"$comment": "pulp2_importer_repository_id field should be specified so we know which importer to use when migrating multiple pulp2 repos into repo versions"
}
}
},
"required": ["type"],
"additionalProperties": false,
"$comment": "if protection field is present then repositories field should be present",
"dependencies": {
"protection": ["repositories"],
"repositories": ["protection"]
}
}
}
},
"required": ["plugins"],
"additionalProperties": false
}'''