github.com/covergates/covergates@v0.2.2-0.20201009050117-42ef8a19fb95/routers/docs/swagger.yaml (about) 1 basePath: /api/v1 2 definitions: 3 core.Commit: 4 properties: 5 committer: 6 type: string 7 committerAvatar: 8 type: string 9 message: 10 type: string 11 sha: 12 type: string 13 type: object 14 core.Repo: 15 properties: 16 branch: 17 type: string 18 id: 19 type: integer 20 name: 21 type: string 22 nameSpace: 23 type: string 24 private: 25 type: boolean 26 reportID: 27 type: string 28 scm: 29 type: SCMProvider 30 url: 31 type: string 32 type: object 33 core.RepoSetting: 34 properties: 35 filters: 36 type: FileNameFilters 37 mergePR: 38 type: boolean 39 protected: 40 type: boolean 41 updateAction: 42 type: ReportUpdateAction 43 type: object 44 core.Report: 45 properties: 46 commit: 47 type: string 48 coverages: 49 items: 50 type: CoverageReport 51 type: array 52 createdAt: 53 type: string 54 files: 55 items: 56 type: string 57 type: array 58 reference: 59 type: string 60 reportID: 61 type: string 62 type: object 63 user.Providers: 64 additionalProperties: 65 type: boolean 66 type: object 67 user.Token: 68 properties: 69 createdAt: 70 type: string 71 id: 72 type: integer 73 name: 74 type: string 75 type: object 76 user.User: 77 properties: 78 avatar: 79 type: string 80 email: 81 type: string 82 login: 83 type: string 84 type: object 85 host: localhost:8080 86 info: 87 contact: {} 88 description: REST API for CodeCover 89 license: 90 name: Apache 2.0 91 url: http://www.apache.org/licenses/LICENSE-2.0.html 92 termsOfService: http://swagger.io/terms/ 93 title: CodeCover API 94 version: "1.0" 95 paths: 96 /reports/{id}: 97 get: 98 parameters: 99 - description: report id 100 in: path 101 name: id 102 required: true 103 type: string 104 - description: get only the latest report 105 in: query 106 name: latest 107 type: boolean 108 - description: get report for git ref 109 in: query 110 name: ref 111 type: string 112 responses: 113 "200": 114 description: coverage report 115 schema: 116 $ref: '#/definitions/core.Report' 117 summary: get reports for the report id 118 tags: 119 - Report 120 post: 121 parameters: 122 - description: report id 123 in: path 124 name: id 125 required: true 126 type: string 127 - description: report 128 in: formData 129 name: file 130 required: true 131 type: file 132 - description: Git commit SHA 133 in: formData 134 name: commit 135 required: true 136 type: string 137 - description: report type 138 in: formData 139 name: type 140 required: true 141 type: string 142 - description: ref 143 in: formData 144 name: ref 145 type: string 146 - description: files list of the repository 147 in: formData 148 name: files 149 type: string 150 responses: 151 "200": 152 description: ok 153 schema: 154 type: string 155 "400": 156 description: error message 157 schema: 158 type: string 159 summary: Upload coverage report 160 tags: 161 - Report 162 /reports/{id}/badge: 163 get: 164 parameters: 165 - description: report id 166 in: path 167 name: id 168 required: true 169 type: string 170 - description: get latest report in main branch 171 in: query 172 name: latest 173 type: boolean 174 responses: 175 "200": 176 description: badge svg 177 schema: 178 type: string 179 summary: get badge for the report id 180 tags: 181 - Report 182 /reports/{id}/card: 183 get: 184 parameters: 185 - description: report id 186 in: path 187 name: id 188 required: true 189 type: string 190 produces: 191 - image/svg+xml 192 responses: 193 "200": 194 description: treemap svg 195 schema: 196 type: string 197 summary: Get status card of the repository 198 tags: 199 - Report 200 /reports/{id}/comment/{number}: 201 post: 202 parameters: 203 - description: report id 204 in: path 205 name: id 206 required: true 207 type: string 208 - description: pull request number 209 in: path 210 name: number 211 required: true 212 type: string 213 responses: 214 "200": 215 description: ok 216 schema: 217 type: string 218 summary: Leave a report summary comment on pull request 219 tags: 220 - Report 221 /reports/{id}/repo: 222 get: 223 parameters: 224 - description: report id 225 in: path 226 name: id 227 required: true 228 type: string 229 responses: 230 "200": 231 description: repository 232 schema: 233 $ref: '#/definitions/core.Repo' 234 "400": 235 description: error message 236 schema: 237 type: string 238 summary: get repository of the report id 239 tags: 240 - Report 241 /reports/{id}/treemap/{ref}: 242 get: 243 parameters: 244 - description: report id 245 in: path 246 name: id 247 required: true 248 type: string 249 - description: source branch 250 in: path 251 name: source 252 required: true 253 type: string 254 produces: 255 - image/svg+xml 256 responses: 257 "200": 258 description: treemap svg 259 schema: 260 type: string 261 summary: Get coverage difference treemap with main branch 262 tags: 263 - Report 264 /repos: 265 get: 266 responses: 267 "200": 268 description: repositories 269 schema: 270 items: 271 $ref: '#/definitions/core.Repo' 272 type: array 273 summary: List repositories for all available SCM providers 274 tags: 275 - Repository 276 post: 277 parameters: 278 - description: repository to create 279 in: body 280 name: repo 281 required: true 282 schema: 283 $ref: '#/definitions/core.Repo' 284 responses: 285 "200": 286 description: Created repository 287 schema: 288 $ref: '#/definitions/core.Repo' 289 summary: Create new repository for code coverage 290 tags: 291 - Repository 292 /repos/{scm}: 293 get: 294 parameters: 295 - description: SCM source (github, gitea) 296 in: path 297 name: scm 298 required: true 299 type: string 300 responses: 301 "200": 302 description: repositories 303 schema: 304 items: 305 $ref: '#/definitions/core.Repo' 306 type: array 307 summary: List repositories 308 tags: 309 - Repository 310 /repos/{scm}/{namespace}/{name}: 311 get: 312 parameters: 313 - description: SCM 314 in: path 315 name: scm 316 required: true 317 type: string 318 - description: Namespace 319 in: path 320 name: namespace 321 required: true 322 type: string 323 - description: name 324 in: path 325 name: name 326 required: true 327 type: string 328 responses: 329 "200": 330 description: OK 331 schema: 332 $ref: '#/definitions/core.Repo' 333 summary: get repository 334 tags: 335 - Repository 336 patch: 337 parameters: 338 - description: SCM 339 in: path 340 name: scm 341 required: true 342 type: string 343 - description: Namespace 344 in: path 345 name: namespace 346 required: true 347 type: string 348 - description: name 349 in: path 350 name: name 351 required: true 352 type: string 353 responses: 354 "200": 355 description: OK 356 schema: 357 $ref: '#/definitions/core.Repo' 358 summary: sync repository information with SCM 359 tags: 360 - Repository 361 /repos/{scm}/{namespace}/{name}/branches: 362 get: 363 parameters: 364 - description: SCM 365 in: path 366 name: scm 367 required: true 368 type: string 369 - description: Namespace 370 in: path 371 name: namespace 372 required: true 373 type: string 374 - description: name 375 in: path 376 name: name 377 required: true 378 type: string 379 responses: 380 "200": 381 description: OK 382 schema: 383 items: 384 type: string 385 type: array 386 summary: list repository branches 387 tags: 388 - Repository 389 /repos/{scm}/{namespace}/{name}/commits: 390 get: 391 parameters: 392 - description: SCM 393 in: path 394 name: scm 395 required: true 396 type: string 397 - description: Namespace 398 in: path 399 name: namespace 400 required: true 401 type: string 402 - description: name 403 in: path 404 name: name 405 required: true 406 type: string 407 - description: branch to list commits from 408 in: query 409 name: ref 410 type: string 411 responses: 412 "200": 413 description: OK 414 schema: 415 items: 416 $ref: '#/definitions/core.Commit' 417 type: array 418 summary: list recent commits 419 tags: 420 - Repository 421 /repos/{scm}/{namespace}/{name}/content/{path}: 422 get: 423 parameters: 424 - description: SCM 425 in: path 426 name: scm 427 required: true 428 type: string 429 - description: Namespace 430 in: path 431 name: namespace 432 required: true 433 type: string 434 - description: name 435 in: path 436 name: name 437 required: true 438 type: string 439 - description: file path 440 in: path 441 name: path 442 required: true 443 type: string 444 - description: specify git ref, default main branch 445 in: query 446 name: ref 447 type: string 448 responses: 449 "200": 450 description: file content 451 schema: 452 type: string 453 summary: Get a file content 454 tags: 455 - Repository 456 /repos/{scm}/{namespace}/{name}/files: 457 get: 458 parameters: 459 - description: SCM 460 in: path 461 name: scm 462 required: true 463 type: string 464 - description: Namespace 465 in: path 466 name: namespace 467 required: true 468 type: string 469 - description: name 470 in: path 471 name: name 472 required: true 473 type: string 474 - description: specify git ref, default main branch 475 in: query 476 name: ref 477 type: string 478 responses: 479 "200": 480 description: files 481 schema: 482 items: 483 type: string 484 type: array 485 summary: List all files in repository 486 tags: 487 - Repository 488 /repos/{scm}/{namespace}/{name}/hook: 489 post: 490 parameters: 491 - description: SCM 492 in: path 493 name: scm 494 required: true 495 type: string 496 - description: Namespace 497 in: path 498 name: namespace 499 required: true 500 type: string 501 - description: name 502 in: path 503 name: name 504 required: true 505 type: string 506 responses: 507 "200": 508 description: OK 509 schema: 510 type: string 511 summary: handle webhook event 512 tags: 513 - Repository 514 /repos/{scm}/{namespace}/{name}/hook/create: 515 post: 516 parameters: 517 - description: SCM 518 in: path 519 name: scm 520 required: true 521 type: string 522 - description: Namespace 523 in: path 524 name: namespace 525 required: true 526 type: string 527 - description: name 528 in: path 529 name: name 530 required: true 531 type: string 532 responses: 533 "200": 534 description: OK 535 schema: 536 type: string 537 summary: create repository webhook 538 tags: 539 - Repository 540 /repos/{scm}/{namespace}/{name}/report: 541 patch: 542 parameters: 543 - description: SCM 544 in: path 545 name: scm 546 required: true 547 type: string 548 - description: Namespace 549 in: path 550 name: namespace 551 required: true 552 type: string 553 - description: name 554 in: path 555 name: name 556 required: true 557 type: string 558 responses: 559 "200": 560 description: updated repository 561 schema: 562 $ref: '#/definitions/core.Repo' 563 summary: renew repository report id 564 tags: 565 - Repository 566 /repos/{scm}/{namespace}/{name}/setting: 567 get: 568 parameters: 569 - description: SCM 570 in: path 571 name: scm 572 required: true 573 type: string 574 - description: Namespace 575 in: path 576 name: namespace 577 required: true 578 type: string 579 - description: name 580 in: path 581 name: name 582 required: true 583 type: string 584 responses: 585 "200": 586 description: OK 587 schema: 588 $ref: '#/definitions/core.RepoSetting' 589 summary: get repository setting 590 tags: 591 - Repository 592 post: 593 parameters: 594 - description: SCM 595 in: path 596 name: scm 597 required: true 598 type: string 599 - description: Namespace 600 in: path 601 name: namespace 602 required: true 603 type: string 604 - description: name 605 in: path 606 name: name 607 required: true 608 type: string 609 - description: repository setting 610 in: body 611 name: setting 612 required: true 613 schema: 614 $ref: '#/definitions/core.RepoSetting' 615 responses: 616 "200": 617 description: OK 618 schema: 619 $ref: '#/definitions/core.RepoSetting' 620 summary: update repository setting 621 tags: 622 - Repository 623 /user: 624 get: 625 responses: 626 "200": 627 description: user 628 schema: 629 $ref: '#/definitions/user.User' 630 "404": 631 description: error 632 schema: 633 type: string 634 summary: Get login user 635 tags: 636 - User 637 /user/owner/{scm}/{namespace}/{name}: 638 get: 639 parameters: 640 - description: SCM 641 in: path 642 name: scm 643 required: true 644 type: string 645 - description: Namespace 646 in: path 647 name: namespace 648 required: true 649 type: string 650 - description: name 651 in: path 652 name: name 653 required: true 654 type: string 655 responses: 656 "200": 657 description: owner 658 schema: 659 $ref: '#/definitions/user.User' 660 summary: Get repository's owner 661 tags: 662 - User 663 /user/repos: 664 get: 665 responses: 666 "200": 667 description: list of repositories 668 schema: 669 items: 670 $ref: '#/definitions/core.Repo' 671 type: array 672 summary: List user synchronized repositories 673 tags: 674 - User 675 patch: 676 responses: 677 "200": 678 description: ok 679 schema: 680 type: string 681 summary: Synchronize user's repository from remote SCM 682 tags: 683 - User 684 /user/scm: 685 get: 686 responses: 687 "200": 688 description: providers 689 schema: 690 $ref: '#/definitions/user.Providers' 691 "404": 692 description: providers 693 schema: 694 $ref: '#/definitions/user.Providers' 695 summary: Get user's SCM binding state 696 tags: 697 - User 698 /user/tokens: 699 get: 700 responses: 701 "200": 702 description: list of tokens 703 schema: 704 items: 705 $ref: '#/definitions/user.Token' 706 type: array 707 summary: list OAuth tokens 708 tags: 709 - User 710 post: 711 parameters: 712 - description: token name 713 in: formData 714 name: name 715 type: string 716 responses: 717 "200": 718 description: OK 719 schema: 720 type: string 721 summary: create OAuth token 722 tags: 723 - User 724 /user/tokens/{id}: 725 delete: 726 parameters: 727 - description: token id 728 in: path 729 name: id 730 required: true 731 type: integer 732 responses: 733 "200": 734 description: deleted token 735 schema: 736 $ref: '#/definitions/user.Token' 737 summary: delete token with id 738 tags: 739 - User 740 swagger: "2.0"