-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocumentation-contract.schema.json
More file actions
150 lines (150 loc) · 4.61 KB
/
Copy pathdocumentation-contract.schema.json
File metadata and controls
150 lines (150 loc) · 4.61 KB
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
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://docs.flyto2.com/schemas/documentation-contract-v1.json",
"title": "Flyto2 documentation contract",
"type": "object",
"additionalProperties": false,
"required": [
"schema_version",
"repository",
"status",
"audiences",
"documentation"
],
"properties": {
"$schema": { "type": "string", "minLength": 1 },
"schema": { "type": "string", "minLength": 1 },
"schema_version": { "const": 1 },
"version": { "const": 1 },
"repository": { "type": "string", "minLength": 2 },
"status": {
"enum": ["active", "experimental", "internal", "deprecated", "generated"]
},
"audiences": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "type": "string", "minLength": 2 }
},
"documentation": {
"type": "object",
"additionalProperties": {
"oneOf": [
{ "type": "string", "minLength": 3 },
{ "$ref": "#/$defs/pathList" },
{ "type": "boolean" }
]
},
"required": ["index", "architecture", "state", "security", "changelog", "feature_reference"],
"properties": {
"index": { "type": "string", "minLength": 3 },
"architecture": { "type": "string", "minLength": 3 },
"state": { "type": "string", "minLength": 3 },
"security": { "type": "string", "minLength": 3 },
"changelog": { "type": "string", "minLength": 3 },
"feature_reference": { "type": "string", "minLength": 3 },
"whitepaper": { "type": "string", "minLength": 3 },
"source_reference": {
"oneOf": [
{ "type": "string", "minLength": 3 },
{ "$ref": "#/$defs/pathList" }
]
},
"source_reference_exclude": { "$ref": "#/$defs/pathList" },
"module_roots": {
"type": "array",
"uniqueItems": true,
"items": { "type": "string", "minLength": 1 }
},
"configuration_not_applicable": { "type": "boolean" }
}
},
"source_areas": {
"type": "array",
"minItems": 1,
"items": { "$ref": "#/$defs/sourceArea" }
},
"owners": {
"type": "array",
"minItems": 1,
"items": { "$ref": "#/$defs/sourceOwner" }
},
"feature_surfaces": {
"type": "array",
"items": { "$ref": "#/$defs/featureSurface" }
},
"budgets": {
"type": "object"
}
},
"allOf": [
{
"anyOf": [
{ "required": ["source_areas"] },
{ "required": ["owners"] }
]
}
],
"$defs": {
"pathList": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "type": "string", "minLength": 1 }
},
"sourceArea": {
"type": "object",
"additionalProperties": false,
"required": ["paths", "documentation"],
"properties": {
"id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" },
"name": { "type": "string", "minLength": 2 },
"description": { "type": "string", "minLength": 30 },
"paths": { "$ref": "#/$defs/pathList" },
"documentation": { "$ref": "#/$defs/pathList" }
},
"anyOf": [
{ "required": ["id"] },
{ "required": ["name"] }
]
},
"sourceOwner": {
"type": "object",
"additionalProperties": false,
"required": ["area", "paths", "docs"],
"properties": {
"area": { "type": "string", "minLength": 2 },
"paths": { "$ref": "#/$defs/pathList" },
"docs": { "$ref": "#/$defs/pathList" }
}
},
"featureSurface": {
"type": "object",
"additionalProperties": false,
"required": ["id", "title", "kind", "status", "description", "source", "documentation"],
"properties": {
"id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" },
"title": { "type": "string", "minLength": 3 },
"kind": {
"enum": ["api", "cli", "configuration", "content", "governance", "library", "operations", "schema", "ui", "workflow"]
},
"status": {
"enum": ["active", "experimental", "internal", "deprecated", "generated"]
},
"description": { "type": "string", "minLength": 40 },
"source": { "$ref": "#/$defs/pathList" },
"documentation": { "$ref": "#/$defs/pathList" },
"tests": {
"type": "array",
"uniqueItems": true,
"items": { "type": "string", "minLength": 1 }
},
"verification": {
"type": "array",
"uniqueItems": true,
"items": { "type": "string", "minLength": 2 }
}
}
}
}
}