Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/src/platform/configuration/common/jsonSchemaDraft7.ts
13400 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { JsonSchema } from './jsonSchema';
7
8
export const jsonSchemaDraft7: JsonSchema = {
9
'title': 'Core schema meta-schema',
10
'definitions': {
11
'schemaArray': {
12
'type': 'array',
13
'minItems': 1,
14
'items': { '$ref': '#' }
15
},
16
'nonNegativeInteger': {
17
'type': 'integer',
18
'minimum': 0
19
},
20
'nonNegativeIntegerDefault0': {
21
'allOf': [
22
{ '$ref': '#/definitions/nonNegativeInteger' },
23
{ 'default': 0 }
24
]
25
},
26
'simpleTypes': {
27
'enum': [
28
'array',
29
'boolean',
30
'integer',
31
'null',
32
'number',
33
'object',
34
'string'
35
]
36
},
37
'stringArray': {
38
'type': 'array',
39
'items': { 'type': 'string' },
40
'uniqueItems': true,
41
'default': []
42
}
43
},
44
'type': ['object', 'boolean'],
45
'properties': {
46
'$id': {
47
'type': 'string',
48
},
49
'$schema': {
50
'type': 'string',
51
'format': 'uri'
52
},
53
'$ref': {
54
'type': 'string',
55
},
56
'$comment': {
57
'type': 'string'
58
},
59
'title': {
60
'type': 'string'
61
},
62
'description': {
63
'type': 'string'
64
},
65
'default': true,
66
'readOnly': {
67
'type': 'boolean',
68
'default': false
69
},
70
'writeOnly': {
71
'type': 'boolean',
72
'default': false
73
},
74
'examples': {
75
'type': 'array',
76
'items': true
77
},
78
'multipleOf': {
79
'type': 'number',
80
'exclusiveMinimum': 0
81
},
82
'maximum': {
83
'type': 'number'
84
},
85
'exclusiveMaximum': {
86
'type': 'number'
87
},
88
'minimum': {
89
'type': 'number'
90
},
91
'exclusiveMinimum': {
92
'type': 'number'
93
},
94
'maxLength': { '$ref': '#/definitions/nonNegativeInteger' },
95
'minLength': { '$ref': '#/definitions/nonNegativeIntegerDefault0' },
96
'pattern': {
97
'type': 'string',
98
'format': 'regex'
99
},
100
'additionalItems': { '$ref': '#' },
101
'items': {
102
'anyOf': [
103
{ '$ref': '#' },
104
{ '$ref': '#/definitions/schemaArray' }
105
],
106
'default': true
107
},
108
'maxItems': { '$ref': '#/definitions/nonNegativeInteger' },
109
'minItems': { '$ref': '#/definitions/nonNegativeIntegerDefault0' },
110
'uniqueItems': {
111
'type': 'boolean',
112
'default': false
113
},
114
'contains': { '$ref': '#' },
115
'maxProperties': { '$ref': '#/definitions/nonNegativeInteger' },
116
'minProperties': { '$ref': '#/definitions/nonNegativeIntegerDefault0' },
117
'required': { '$ref': '#/definitions/stringArray' },
118
'additionalProperties': { '$ref': '#' },
119
'definitions': {
120
'type': 'object',
121
'additionalProperties': { '$ref': '#' },
122
'default': {}
123
},
124
'properties': {
125
'type': 'object',
126
'additionalProperties': { '$ref': '#' },
127
'default': {}
128
},
129
'patternProperties': {
130
'type': 'object',
131
'additionalProperties': { '$ref': '#' },
132
'propertyNames': { 'format': 'regex' },
133
'default': {}
134
},
135
'dependencies': {
136
'type': 'object',
137
'additionalProperties': {
138
'anyOf': [
139
{ '$ref': '#' },
140
{ '$ref': '#/definitions/stringArray' }
141
]
142
}
143
},
144
'propertyNames': { '$ref': '#' },
145
'const': true,
146
'enum': {
147
'type': 'array',
148
'items': true,
149
'minItems': 1,
150
'uniqueItems': true
151
},
152
'type': {
153
'anyOf': [
154
{ '$ref': '#/definitions/simpleTypes' },
155
{
156
'type': 'array',
157
'items': { '$ref': '#/definitions/simpleTypes' },
158
'minItems': 1,
159
'uniqueItems': true
160
}
161
]
162
},
163
'format': { 'type': 'string' },
164
'contentMediaType': { 'type': 'string' },
165
'contentEncoding': { 'type': 'string' },
166
'if': { '$ref': '#' },
167
'then': { '$ref': '#' },
168
'else': { '$ref': '#' },
169
'allOf': { '$ref': '#/definitions/schemaArray' },
170
'anyOf': { '$ref': '#/definitions/schemaArray' },
171
'oneOf': { '$ref': '#/definitions/schemaArray' },
172
'not': { '$ref': '#' }
173
},
174
'default': true
175
};
176
177