-
Notifications
You must be signed in to change notification settings - Fork 177
/
CodeFile.json
298 lines (298 loc) · 11.1 KB
/
CodeFile.json
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "CodeFile.json",
"type": "object",
"properties": {
"PackageName": {
"type": "string"
},
"PackageVersion": {
"type": "string"
},
"ParserVersion": {
"type": "string",
"description": "version of the APIview language parser used to create token file"
},
"Language": {
"anyOf": [
{
"type": "string",
"const": "C"
},
{
"type": "string",
"const": "C++"
},
{
"type": "string",
"const": "C#"
},
{
"type": "string",
"const": "Go"
},
{
"type": "string",
"const": "Java"
},
{
"type": "string",
"const": "JavaScript"
},
{
"type": "string",
"const": "Kotlin"
},
{
"type": "string",
"const": "Python"
},
{
"type": "string",
"const": "Swagger"
},
{
"type": "string",
"const": "Swift"
},
{
"type": "string",
"const": "TypeSpec"
}
]
},
"LanguageVariant": {
"anyOf": [
{
"type": "string",
"const": "None"
},
{
"type": "string",
"const": "Spring"
},
{
"type": "string",
"const": "Android"
}
],
"default": "None",
"description": "Language variant is applicable only for java variants"
},
"CrossLanguagePackageId": {
"type": "string"
},
"ReviewLines": {
"type": "array",
"items": {
"$ref": "#/$defs/ReviewLine"
}
},
"Diagnostics": {
"type": "array",
"items": {
"$ref": "#/$defs/CodeDiagnostic"
},
"description": "Add any system generated comments. Each comment is linked to review line ID"
},
"Navigation": {
"type": "array",
"items": {
"$ref": "#/$defs/NavigationItem"
},
"description": "Navigation items are used to create a tree view in the navigation panel. Each navigation item is linked to a review line ID. This is optional.\nIf navigation items are not provided then navigation panel will be automatically generated using the review lines. Navigation items should be provided only if you want to customize the navigation panel."
}
},
"required": [
"PackageName",
"PackageVersion",
"ParserVersion",
"Language",
"ReviewLines"
],
"description": "ReviewFile represents entire API review object. This will be processed to render review lines.",
"$defs": {
"ReviewLine": {
"type": "object",
"properties": {
"LineId": {
"type": "string",
"description": "lineId is only required if we need to support commenting on a line that contains this token. \nUsually code line for documentation or just punctuation is not required to have lineId. lineId should be a unique value within \nthe review token file to use it assign to review comments as well as navigation Id within the review page.\nfor e.g Azure.Core.HttpHeader.Common, azure.template.template_main"
},
"CrossLanguageId": {
"type": "string"
},
"Tokens": {
"type": "array",
"items": {
"$ref": "#/$defs/ReviewToken"
},
"description": "list of tokens that constructs a line in API review"
},
"Children": {
"type": "array",
"items": {
"$ref": "#/$defs/ReviewLine"
},
"description": "Add any child lines as children. For e.g. all classes and namespace level methods are added as a children of namespace(module) level code line. \nSimilarly all method level code lines are added as children of it's class code line."
},
"IsHidden": {
"type": "boolean",
"description": "Set current line as hidden code line by default. .NET has hidden APIs and architects don't want to see them by default."
},
"IsContextEndLine": {
"type": "boolean",
"description": "Set current line as context end line. For e.g. line with token } or empty line after the class to mark end of context."
},
"RelatedToLine": {
"type": "string",
"description": "Set ID of related line to ensure current line is not visible when a related line is hidden.\nOne e.g. is a code line for class attribute should set class line's Line ID as related line ID."
}
},
"required": [
"Tokens"
],
"description": "ReviewLine object corresponds to each line displayed on API review. If an empty line is required then add a code line object without any token."
},
"CodeDiagnostic": {
"type": "object",
"properties": {
"DiagnosticId": {
"type": "string",
"description": "Diagnostic ID is auto generated ID by CSharp analyzer."
},
"TargetId": {
"type": "string",
"description": "Id of ReviewLine object where this diagnostic needs to be displayed"
},
"Text": {
"type": "string",
"description": "Auto generated system comment to be displayed under targeted line."
},
"Level": {
"$ref": "#/$defs/CodeDiagnosticLevel"
},
"HelpLinkUri": {
"type": "string"
}
},
"required": [
"TargetId",
"Text",
"Level"
],
"description": "System comment object is to add system generated comment. It can be one of the 4 different types of system comments."
},
"NavigationItem": {
"type": "object",
"properties": {
"Text": {
"type": "string"
},
"NavigationId": {
"type": "string"
},
"ChildItems": {
"type": "array",
"items": {
"$ref": "#/$defs/NavigationItem"
}
},
"Tags": {
"$ref": "#/$defs/RecordString"
}
},
"required": [
"Text",
"NavigationId",
"ChildItems",
"Tags"
]
},
"ReviewToken": {
"type": "object",
"properties": {
"Kind": {
"$ref": "#/$defs/TokenKind"
},
"Value": {
"type": "string"
},
"NavigationDisplayName": {
"type": "string",
"description": "NavigationDisplayName is used to create a tree node in the navigation panel. Navigation nodes will be created only if token contains navigation display name."
},
"NavigateToId": {
"type": "string",
"description": "navigateToId should be set if the underlying token is required to be displayed as HREF to another type within the review.\nFor e.g. a param type which is class name in the same package"
},
"SkipDiff": {
"type": "boolean",
"default": false,
"description": "set skipDiff to true if underlying token needs to be ignored from diff calculation. For e.g. package metadata or dependency versions \nare usually excluded when comparing two revisions to avoid reporting them as API changes"
},
"IsDeprecated": {
"type": "boolean",
"default": false,
"description": "This is set if API is marked as deprecated"
},
"HasSuffixSpace": {
"type": "boolean",
"default": true,
"description": "Set this to false if there is no suffix space required before next token. For e.g, punctuation right after method name"
},
"HasPrefixSpace": {
"type": "boolean",
"default": false,
"description": "Set this to true if there is a prefix space required before current token. For e.g, space before token for ="
},
"IsDocumentation": {
"type": "boolean",
"default": false,
"description": "Set isDocumentation to true if current token is part of documentation"
},
"RenderClasses": {
"type": "array",
"items": {
"type": "string"
},
"description": "Language specific style css class names"
}
},
"required": [
"Kind",
"Value"
],
"description": "Token corresponds to each component within a code line. A separate token is required for keyword, punctuation, type name, text etc."
},
"CodeDiagnosticLevel": {
"type": "number",
"enum": [
1,
2,
3,
4
]
},
"RecordString": {
"type": "object",
"properties": {},
"additionalProperties": {
"type": "string"
}
},
"TokenKind": {
"type": "number",
"enum": [
0,
1,
2,
3,
4,
5,
6,
7
]
}
}
}