-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.json
536 lines (536 loc) · 21.8 KB
/
swagger.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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
{
"openapi" : "3.0.1",
"info" : {
"title" : "Code Review Assistant for Bitbucket Server REST API",
"description" : "REST API documentation for the plug-in Code Review Assistant for Bitbucket Server.\n The REST API allows you to maintain the repository settings of the\n plug-in as well as the repo-level and global custom static analyzer configurations.\n The plug-in differentiates between built-in and custom\n (user-defined) static analyzer configurations.\n With repository settings you can specify the behaviour of the plug-in for each\n repository individually. Global static analyzer configurations allow\n you to share common analyzer configurations across all your repositories.",
"contact" : {
"name" : "Mibex Software GmbH",
"url" : "https://www.mibexsoftware.com"
},
"license" : {
"name" : "Copyright (c) 2023 by Mibex Software GmbH, Switzerland. All rights reserved.",
"url" : "https://mibexsoftware.com/imprint/"
},
"version" : "v1"
},
"servers" : [ {
"url" : "https://YOUR_BITBUCKET_SERVER/rest/cra/1.0"
} ],
"paths" : {
"/global-checker-configs" : {
"get" : {
"tags" : [ "(Deprecated) Global static analyzer configurations" ],
"summary" : "Returns the global static analyzer configurations.",
"operationId" : "getGlobalCheckers",
"responses" : {
"200" : {
"description" : "Global static analyzer configurations found"
},
"401" : {
"description" : "The currently authenticated user does not have ADMIN permissions"
}
}
},
"put" : {
"tags" : [ "(Deprecated) Global static analyzer configurations" ],
"summary" : "Updates a global static analyzer configuration.",
"operationId" : "updateConfig",
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/CustomCheckerConfig"
}
}
},
"required" : true
},
"responses" : {
"200" : {
"description" : "Global static analyzer configuration updated",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/CustomCheckerConfig"
}
}
}
},
"401" : {
"description" : "The currently authenticated user does not have ADMIN permissions"
},
"404" : {
"description" : "The global static analyzer configuration does not exist"
}
}
},
"post" : {
"tags" : [ "(Deprecated) Global static analyzer configurations" ],
"summary" : "Creates a global static analyzer configuration.",
"operationId" : "addConfig",
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/CustomCheckerConfig"
}
}
},
"required" : true
},
"responses" : {
"200" : {
"description" : "Global static analyzer configuration created",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/CustomCheckerConfig"
}
}
}
},
"401" : {
"description" : "The currently authenticated user does not have ADMIN permissions"
},
"404" : {
"description" : "The global static analyzer configuration does not exist"
}
}
},
"delete" : {
"tags" : [ "(Deprecated) Global static analyzer configurations" ],
"summary" : "Deletes a global static analyzer configuration.",
"operationId" : "deleteConfig",
"parameters" : [ {
"name" : "id",
"in" : "query",
"schema" : {
"type" : "integer",
"format" : "int32"
}
} ],
"responses" : {
"200" : {
"description" : "Global static analyzer configuration has been deleted"
},
"401" : {
"description" : "The currently authenticated user does not have ADMIN permissions"
},
"404" : {
"description" : "The global static analyzer configuration does not exist"
}
}
}
},
"/projects/{projectKey}/repos/{repositorySlug}/checker-configs" : {
"get" : {
"tags" : [ "(Deprecated) Repository custom static analyzer configurations" ],
"summary" : "Returns the repository static analyzer configurations.",
"operationId" : "getRepoCustomCheckers",
"parameters" : [ {
"name" : "projectKey",
"in" : "path",
"required" : true,
"schema" : {
"type" : "string"
}
}, {
"name" : "repositorySlug",
"in" : "path",
"required" : true,
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"200" : {
"description" : "Repository static analyzer configurations found"
},
"401" : {
"description" : "The currently authenticated user does not have REPO_ADMIN permissions"
}
}
},
"put" : {
"tags" : [ "(Deprecated) Repository custom static analyzer configurations" ],
"summary" : "Updates a repository static analyzer configuration.",
"operationId" : "updateConfig_1",
"parameters" : [ {
"name" : "projectKey",
"in" : "path",
"required" : true,
"schema" : {
"type" : "string"
}
}, {
"name" : "repositorySlug",
"in" : "path",
"required" : true,
"schema" : {
"type" : "string"
}
} ],
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/CustomCheckerConfig"
}
}
},
"required" : true
},
"responses" : {
"200" : {
"description" : "Repository static analyzer configuration updated",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/CustomCheckerConfig"
}
}
}
},
"401" : {
"description" : "The currently authenticated user does not have REPO_ADMIN permissions"
},
"404" : {
"description" : "The repository static analyzer configuration does not exist"
}
}
},
"post" : {
"tags" : [ "(Deprecated) Repository custom static analyzer configurations" ],
"summary" : "Creates a repository static analyzer configuration.",
"operationId" : "addConfig_1",
"parameters" : [ {
"name" : "projectKey",
"in" : "path",
"required" : true,
"schema" : {
"type" : "string"
}
}, {
"name" : "repositorySlug",
"in" : "path",
"required" : true,
"schema" : {
"type" : "string"
}
} ],
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/CustomCheckerConfig"
}
}
},
"required" : true
},
"responses" : {
"200" : {
"description" : "Repository static analyzer configuration created",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/CustomCheckerConfig"
}
}
}
},
"401" : {
"description" : "The currently authenticated user does not have REPO_ADMIN permissions"
},
"404" : {
"description" : "The repository static analyzer configuration does not exist"
}
}
},
"delete" : {
"tags" : [ "(Deprecated) Repository custom static analyzer configurations" ],
"summary" : "Deletes a repository static analyzer configuration.",
"operationId" : "deleteConfig_1",
"parameters" : [ {
"name" : "projectKey",
"in" : "path",
"required" : true,
"schema" : {
"type" : "string"
}
}, {
"name" : "repositorySlug",
"in" : "path",
"required" : true,
"schema" : {
"type" : "string"
}
}, {
"name" : "id",
"in" : "query",
"schema" : {
"type" : "integer",
"format" : "int32"
}
} ],
"responses" : {
"200" : {
"description" : "Repository static analyzer configuration deleted"
},
"401" : {
"description" : "The currently authenticated user does not have REPO_ADMIN permissions"
},
"404" : {
"description" : "The repository static analyzer configuration does not exist"
}
}
}
},
"/projects/{projectKey}/repos/{repositorySlug}/settings" : {
"get" : {
"tags" : [ "Repository settings" ],
"summary" : "Returns the repository settings of the plug-in.",
"operationId" : "getRepoSettings",
"parameters" : [ {
"name" : "projectKey",
"in" : "path",
"required" : true,
"schema" : {
"type" : "string"
}
}, {
"name" : "repositorySlug",
"in" : "path",
"required" : true,
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"200" : {
"description" : "Repository settings found"
},
"401" : {
"description" : "The currently authenticated user does not have REPO_ADMIN permissions"
},
"404" : {
"description" : "The given repository does not exist or there are no settings for this repository"
}
}
},
"post" : {
"tags" : [ "Repository settings" ],
"summary" : "Creates or updates the repository settings for the plug-in.",
"operationId" : "createOrUpdateRepoSettings",
"parameters" : [ {
"name" : "projectKey",
"in" : "path",
"required" : true,
"schema" : {
"type" : "string"
}
}, {
"name" : "repositorySlug",
"in" : "path",
"required" : true,
"schema" : {
"type" : "string"
}
} ],
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/RestRepoConfig"
}
}
},
"required" : true
},
"responses" : {
"200" : {
"description" : "Creates or updates the repository settings for the plug-in.",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/RestRepoConfig"
}
}
}
},
"400" : {
"description" : "Invalid parameters or mandatory parameters not passed"
},
"401" : {
"description" : "The currently authenticated user does not have REPO_ADMIN permissions"
},
"404" : {
"description" : "The given repository does not exist or there are no settings for this repository"
}
}
},
"delete" : {
"tags" : [ "Repository settings" ],
"summary" : "Deletes repository settings for the plug-in.",
"operationId" : "deleteRepoSettings",
"parameters" : [ {
"name" : "projectKey",
"in" : "path",
"required" : true,
"schema" : {
"type" : "string"
}
}, {
"name" : "repositorySlug",
"in" : "path",
"required" : true,
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"200" : {
"description" : "Repository configuration deletedfound"
},
"401" : {
"description" : "The currently authenticated user does not have REPO_ADMIN permissions"
},
"404" : {
"description" : "The given repository does not exist or there are no settings for this repository"
}
}
}
}
},
"components" : {
"schemas" : {
"CustomCheckerConfig" : {
"type" : "object",
"properties" : {
"defaultSeverity" : {
"type" : "string",
"description" : "If your custom analyzer does not support severity levels for found issues or if they do not match FATAL|ERROR|WARNING|INFO, you can define which default severity violations should have.",
"enum" : [ "FATAL", "ERROR", "WARNING", "INFO" ]
},
"fileExtensionsToProcess" : {
"type" : "string",
"description" : "A list of file endings which should be analyzed, separated by whitespace. Example: js javascript"
},
"globalAnalyzerId" : {
"type" : "integer",
"description" : "Reference a global analyzer configuration. Only possible when used on the repository level.",
"format" : "int32"
},
"id" : {
"type" : "integer",
"description" : "ID of the custom analyzer configuration. Only necessary when updating/deleting a configuration.",
"format" : "int32"
},
"issueParseRegex" : {
"type" : "string",
"description" : "A Java regular expression to parse the output of the tool. It should contain named groups for the severity level (if not provided you must specify a default severity below), the file path, the line number and the message. Example: (?<severity>.*?) (?<file>.*?):(?<line>\\d+):\\d+: (?<message>.*) will match \"ERROR /path/to/HelloWorld.java:26:27: 42 is a magic number. [MagicNumber]\""
},
"maxMergeErrors" : {
"type" : "integer",
"description" : "This is the maximum number of reported violations with severity ERROR or FATAL allowed to merge a pull request. Leave empty to always allow merging.",
"format" : "int32"
},
"name" : {
"type" : "string",
"description" : "This name will be used to report violations in the code of your pull requests."
},
"toolArguments" : {
"type" : "string",
"description" : "The arguments for the analyzer including a placeholder %f which will be replaced with the path to the file or %fs which will be replaced with a space-delimited list of all file paths to analyze (will only require one process to analyze your pull request compared to %f). Note that repository relative paths for config files etc. are also possible (see the following example where mycheckstyle.xml is taken from the repository). Example for using Checkstyle: -jar checkstyle-7.7-all.jar -c mycheckstyle.xml %fs"
},
"toolCommand" : {
"type" : "string",
"description" : "The path to the tool to invoke, can either be absolute (e.g. /usr/local/bin/jscs) or relative to the repository (e.g., ./node_modules/.bin/eslint)"
}
}
},
"RestBuiltinAnalyzerConfig" : {
"type" : "object",
"properties" : {
"configFrom" : {
"type" : "string",
"description" : "Use either built-in configuration, one from a Git repository or one from an URL or path in the file system.",
"enum" : [ "BUILTIN", "FROM_REPO", "FROM_URL" ]
},
"configRepoPath" : {
"type" : "string",
"description" : "The relative path to the config file in this Git repository (e.g., config/tools/pmd-all.xml)."
},
"configUrl" : {
"type" : "string",
"description" : "Provide an URL (e.g., https://github.com/pmd/pmd.xml) where the config can be fetched from or an absolute path (e.g., /home/bitbucket/pmd.xml) that is accessible in the filesystem you run Bitbucket Server on."
},
"enabled" : {
"type" : "boolean",
"description" : "Only enabled checkers will be executed when your pull requests are analyzed."
},
"maxMergeErrors" : {
"type" : "integer",
"description" : "This is the maximum number of reported violations with severity ERROR or FATAL allowed to merge a pull request. Leave empty to always allow merging.",
"format" : "int32"
},
"name" : {
"type" : "string",
"description" : "This is the name of the built-in static analyzer.",
"enum" : [ "PMD", "Scalastyle", "CodeNarc", "JSLint", "JSHint" ]
},
"violationExamplesEnabled" : {
"type" : "boolean",
"description" : "Currently only supported by PMD; when enabled, shows examples for the found violations"
}
},
"description" : "(Deprecated, use showCodeAnalysisInPullRequest instead) List of built-in static analyzers to use for pull requests of this repository."
},
"RestRepoConfig" : {
"type" : "object",
"properties" : {
"branchOptions" : {
"type" : "string",
"description" : "Configure which branches should be analyzed or which should be ignored (default is to analyze all branches).",
"enum" : [ "WHITE_LIST", "BLACK_LIST" ]
},
"branchOptionsBranches" : {
"type" : "string",
"description" : "You can use patterns as known from Bitbucket's branch permissions (syntax reference). Use whitespace as delimiter. Example: release-* develop"
},
"bugPredictionAlertText" : {
"type" : "string",
"description" : "(Deprecated) Commits with messages that contain matches for this regex will be considered as bug-fixing commits. Examples: \"fix(es|ed)?\" or \"fixes [A-Z]+-\\d+\"\n"
},
"bugPredictionEnabled" : {
"type" : "boolean",
"description" : "(Deprecated) This marks files that have been recognized as hotspots in pull requests with a special comment that the reviewer should take extra care when reviewing this file. The plug-ins ranks files by the number of times they have been changed with a bug-fixing commit (i.e. a commit which fixes a bug) in the past and considers the top 10% as hotspots."
},
"bugPredictionRegex" : {
"type" : "string",
"description" : "(Deprecated) This text will be shown in the pull request comment for the reviewer when a file is considered as a hotspot."
},
"builtinCheckers" : {
"type" : "array",
"description" : "(Deprecated, use showCodeAnalysisInPullRequest instead) List of built-in static analyzers to use for pull requests of this repository.",
"items" : {
"$ref" : "#/components/schemas/RestBuiltinAnalyzerConfig"
}
},
"pullRequestTemplatesEnabled" : {
"type" : "boolean",
"description" : "(Deprecated) Pull request templates allow you to define a template markdown text for pull request descriptions that help contributors to add the right details when they create a pull request. Just add a file PULL_REQUEST_TEMPLATE.md (or if you do not want to clutter the root directory of your project .bitbucket/PULL_REQUEST_TEMPLATE.md) to the default branch of your repository and enable this setting to get started."
},
"showCodeAnalysisInPullRequest" : {
"type" : "boolean",
"description" : "Show Code Analyzes in PullRequest. Reads the build logs to extract the analyzers results."
},
"showSeverityIcon" : {
"type" : "boolean",
"description" : "Show severity icon in pull request messages for detected code issues (takes more space compared to plain text severity)."
}
}
}
}
}
}