|
1 | 1 | {
|
2 | 2 | "$schema": "https://json-schema.org/draft/2020-12/schema",
|
3 | 3 | "$id": "CodeFile.json",
|
4 |
| - "type": "object", |
5 |
| - "properties": { |
6 |
| - "PackageName": { |
7 |
| - "type": "string" |
8 |
| - }, |
9 |
| - "PackageVersion": { |
10 |
| - "type": "string" |
11 |
| - }, |
12 |
| - "ParserVersion": { |
13 |
| - "type": "string", |
14 |
| - "description": "version of the APIview language parser used to create token file" |
15 |
| - }, |
16 |
| - "Language": { |
17 |
| - "anyOf": [ |
18 |
| - { |
19 |
| - "type": "string", |
20 |
| - "const": "C" |
21 |
| - }, |
22 |
| - { |
23 |
| - "type": "string", |
24 |
| - "const": "C++" |
25 |
| - }, |
26 |
| - { |
27 |
| - "type": "string", |
28 |
| - "const": "C#" |
29 |
| - }, |
30 |
| - { |
31 |
| - "type": "string", |
32 |
| - "const": "Go" |
33 |
| - }, |
34 |
| - { |
35 |
| - "type": "string", |
36 |
| - "const": "Java" |
37 |
| - }, |
38 |
| - { |
39 |
| - "type": "string", |
40 |
| - "const": "JavaScript" |
| 4 | + "$defs": { |
| 5 | + "CodeFile": { |
| 6 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 7 | + "$id": "CodeFile.json", |
| 8 | + "type": "object", |
| 9 | + "properties": { |
| 10 | + "PackageName": { |
| 11 | + "type": "string" |
41 | 12 | },
|
42 |
| - { |
43 |
| - "type": "string", |
44 |
| - "const": "Kotlin" |
| 13 | + "PackageVersion": { |
| 14 | + "type": "string" |
45 | 15 | },
|
46 |
| - { |
| 16 | + "ParserVersion": { |
47 | 17 | "type": "string",
|
48 |
| - "const": "Python" |
| 18 | + "description": "version of the APIview language parser used to create token file" |
49 | 19 | },
|
50 |
| - { |
51 |
| - "type": "string", |
52 |
| - "const": "Swagger" |
| 20 | + "Language": { |
| 21 | + "anyOf": [ |
| 22 | + { |
| 23 | + "type": "string", |
| 24 | + "const": "C" |
| 25 | + }, |
| 26 | + { |
| 27 | + "type": "string", |
| 28 | + "const": "C++" |
| 29 | + }, |
| 30 | + { |
| 31 | + "type": "string", |
| 32 | + "const": "C#" |
| 33 | + }, |
| 34 | + { |
| 35 | + "type": "string", |
| 36 | + "const": "Go" |
| 37 | + }, |
| 38 | + { |
| 39 | + "type": "string", |
| 40 | + "const": "Java" |
| 41 | + }, |
| 42 | + { |
| 43 | + "type": "string", |
| 44 | + "const": "JavaScript" |
| 45 | + }, |
| 46 | + { |
| 47 | + "type": "string", |
| 48 | + "const": "Kotlin" |
| 49 | + }, |
| 50 | + { |
| 51 | + "type": "string", |
| 52 | + "const": "Python" |
| 53 | + }, |
| 54 | + { |
| 55 | + "type": "string", |
| 56 | + "const": "Swagger" |
| 57 | + }, |
| 58 | + { |
| 59 | + "type": "string", |
| 60 | + "const": "Swift" |
| 61 | + }, |
| 62 | + { |
| 63 | + "type": "string", |
| 64 | + "const": "TypeSpec" |
| 65 | + } |
| 66 | + ] |
53 | 67 | },
|
54 |
| - { |
55 |
| - "type": "string", |
56 |
| - "const": "Swift" |
| 68 | + "LanguageVariant": { |
| 69 | + "anyOf": [ |
| 70 | + { |
| 71 | + "type": "string", |
| 72 | + "const": "None" |
| 73 | + }, |
| 74 | + { |
| 75 | + "type": "string", |
| 76 | + "const": "Spring" |
| 77 | + }, |
| 78 | + { |
| 79 | + "type": "string", |
| 80 | + "const": "Android" |
| 81 | + } |
| 82 | + ], |
| 83 | + "default": "None", |
| 84 | + "description": "Language variant is applicable only for java variants" |
57 | 85 | },
|
58 |
| - { |
59 |
| - "type": "string", |
60 |
| - "const": "TypeSpec" |
61 |
| - } |
62 |
| - ] |
63 |
| - }, |
64 |
| - "LanguageVariant": { |
65 |
| - "anyOf": [ |
66 |
| - { |
67 |
| - "type": "string", |
68 |
| - "const": "None" |
| 86 | + "CrossLanguagePackageId": { |
| 87 | + "type": "string" |
69 | 88 | },
|
70 |
| - { |
71 |
| - "type": "string", |
72 |
| - "const": "Spring" |
| 89 | + "ReviewLines": { |
| 90 | + "type": "array", |
| 91 | + "items": { |
| 92 | + "$ref": "ReviewLine.json" |
| 93 | + } |
73 | 94 | },
|
74 |
| - { |
75 |
| - "type": "string", |
76 |
| - "const": "Android" |
| 95 | + "Diagnostics": { |
| 96 | + "type": "array", |
| 97 | + "items": { |
| 98 | + "$ref": "CodeDiagnostic.json" |
| 99 | + }, |
| 100 | + "description": "Add any system generated comments. Each comment is linked to review line ID" |
77 | 101 | }
|
| 102 | + }, |
| 103 | + "required": [ |
| 104 | + "PackageName", |
| 105 | + "PackageVersion", |
| 106 | + "ParserVersion", |
| 107 | + "Language", |
| 108 | + "ReviewLines" |
78 | 109 | ],
|
79 |
| - "default": "None", |
80 |
| - "description": "Language variant is applicable only for java variants" |
81 |
| - }, |
82 |
| - "CrossLanguagePackageId": { |
83 |
| - "type": "string" |
| 110 | + "description": "ReviewFile represents entire API review object. This will be processed to render review lines." |
84 | 111 | },
|
85 |
| - "ReviewLines": { |
86 |
| - "type": "array", |
87 |
| - "items": { |
88 |
| - "$ref": "#/$defs/ReviewLine" |
89 |
| - } |
90 |
| - }, |
91 |
| - "Diagnostics": { |
92 |
| - "type": "array", |
93 |
| - "items": { |
94 |
| - "$ref": "#/$defs/CodeDiagnostic" |
95 |
| - }, |
96 |
| - "description": "Add any system generated comments. Each comment is linked to review line ID" |
97 |
| - } |
98 |
| - }, |
99 |
| - "required": [ |
100 |
| - "PackageName", |
101 |
| - "PackageVersion", |
102 |
| - "ParserVersion", |
103 |
| - "Language", |
104 |
| - "ReviewLines" |
105 |
| - ], |
106 |
| - "description": "ReviewFile represents entire API review object. This will be processed to render review lines.", |
107 |
| - "$defs": { |
108 | 112 | "ReviewLine": {
|
| 113 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 114 | + "$id": "ReviewLine.json", |
109 | 115 | "type": "object",
|
110 | 116 | "properties": {
|
111 | 117 | "LineId": {
|
|
118 | 124 | "Tokens": {
|
119 | 125 | "type": "array",
|
120 | 126 | "items": {
|
121 |
| - "$ref": "#/$defs/ReviewToken" |
| 127 | + "$ref": "ReviewToken.json" |
122 | 128 | },
|
123 | 129 | "description": "list of tokens that constructs a line in API review"
|
124 | 130 | },
|
125 | 131 | "Children": {
|
126 | 132 | "type": "array",
|
127 | 133 | "items": {
|
128 |
| - "$ref": "#/$defs/ReviewLine" |
| 134 | + "$ref": "ReviewLine.json" |
129 | 135 | },
|
130 | 136 | "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."
|
131 | 137 | },
|
|
147 | 153 | ],
|
148 | 154 | "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."
|
149 | 155 | },
|
150 |
| - "CodeDiagnostic": { |
151 |
| - "type": "object", |
152 |
| - "properties": { |
153 |
| - "DiagnosticId": { |
154 |
| - "type": "string", |
155 |
| - "description": "Diagnostic ID is auto generated ID by CSharp analyzer." |
156 |
| - }, |
157 |
| - "TargetId": { |
158 |
| - "type": "string", |
159 |
| - "description": "Id of ReviewLine object where this diagnostic needs to be displayed" |
160 |
| - }, |
161 |
| - "Text": { |
162 |
| - "type": "string", |
163 |
| - "description": "Auto generated system comment to be displayed under targeted line." |
164 |
| - }, |
165 |
| - "Level": { |
166 |
| - "$ref": "#/$defs/CodeDiagnosticLevel" |
167 |
| - }, |
168 |
| - "HelpLinkUri": { |
169 |
| - "type": "string" |
170 |
| - } |
171 |
| - }, |
172 |
| - "required": [ |
173 |
| - "TargetId", |
174 |
| - "Text", |
175 |
| - "Level" |
176 |
| - ], |
177 |
| - "description": "System comment object is to add system generated comment. It can be one of the 4 different types of system comments." |
178 |
| - }, |
179 | 156 | "ReviewToken": {
|
| 157 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 158 | + "$id": "ReviewToken.json", |
180 | 159 | "type": "object",
|
181 | 160 | "properties": {
|
182 | 161 | "Kind": {
|
183 |
| - "$ref": "#/$defs/TokenKind" |
| 162 | + "$ref": "TokenKind.json" |
184 | 163 | },
|
185 | 164 | "Value": {
|
186 | 165 | "type": "string"
|
|
227 | 206 | ],
|
228 | 207 | "description": "Token corresponds to each component within a code line. A separate token is required for keyword, punctuation, type name, text etc."
|
229 | 208 | },
|
230 |
| - "CodeDiagnosticLevel": { |
| 209 | + "TokenKind": { |
| 210 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 211 | + "$id": "TokenKind.json", |
231 | 212 | "type": "number",
|
232 | 213 | "enum": [
|
| 214 | + 0, |
233 | 215 | 1,
|
234 | 216 | 2,
|
235 | 217 | 3,
|
236 |
| - 4 |
| 218 | + 4, |
| 219 | + 5, |
| 220 | + 6, |
| 221 | + 7 |
237 | 222 | ]
|
238 | 223 | },
|
239 |
| - "TokenKind": { |
| 224 | + "CodeDiagnostic": { |
| 225 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 226 | + "$id": "CodeDiagnostic.json", |
| 227 | + "type": "object", |
| 228 | + "properties": { |
| 229 | + "DiagnosticId": { |
| 230 | + "type": "string", |
| 231 | + "description": "Diagnostic ID is auto generated ID by CSharp analyzer." |
| 232 | + }, |
| 233 | + "TargetId": { |
| 234 | + "type": "string", |
| 235 | + "description": "Id of ReviewLine object where this diagnostic needs to be displayed" |
| 236 | + }, |
| 237 | + "Text": { |
| 238 | + "type": "string", |
| 239 | + "description": "Auto generated system comment to be displayed under targeted line." |
| 240 | + }, |
| 241 | + "Level": { |
| 242 | + "$ref": "CodeDiagnosticLevel.json" |
| 243 | + }, |
| 244 | + "HelpLinkUri": { |
| 245 | + "type": "string" |
| 246 | + } |
| 247 | + }, |
| 248 | + "required": [ |
| 249 | + "TargetId", |
| 250 | + "Text", |
| 251 | + "Level" |
| 252 | + ], |
| 253 | + "description": "System comment object is to add system generated comment. It can be one of the 4 different types of system comments." |
| 254 | + }, |
| 255 | + "CodeDiagnosticLevel": { |
| 256 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 257 | + "$id": "CodeDiagnosticLevel.json", |
240 | 258 | "type": "number",
|
241 | 259 | "enum": [
|
242 |
| - 0, |
243 | 260 | 1,
|
244 | 261 | 2,
|
245 | 262 | 3,
|
246 |
| - 4, |
247 |
| - 5, |
248 |
| - 6, |
249 |
| - 7 |
| 263 | + 4 |
250 | 264 | ]
|
251 | 265 | }
|
252 | 266 | }
|
|
0 commit comments