|
587 | 587 | "webUrl" |
588 | 588 | ] |
589 | 589 | }, |
| 590 | + "PublicFileBlameResponse": { |
| 591 | + "type": "object", |
| 592 | + "properties": { |
| 593 | + "ranges": { |
| 594 | + "type": "array", |
| 595 | + "items": { |
| 596 | + "type": "object", |
| 597 | + "properties": { |
| 598 | + "hash": { |
| 599 | + "type": "string", |
| 600 | + "description": "The hash of the commit that last modified the lines in this range." |
| 601 | + }, |
| 602 | + "startLine": { |
| 603 | + "type": "integer", |
| 604 | + "minimum": 0, |
| 605 | + "exclusiveMinimum": true, |
| 606 | + "description": "The 1-based line number where the range begins (inclusive)." |
| 607 | + }, |
| 608 | + "lineCount": { |
| 609 | + "type": "integer", |
| 610 | + "minimum": 0, |
| 611 | + "exclusiveMinimum": true, |
| 612 | + "description": "The number of contiguous lines in this range." |
| 613 | + } |
| 614 | + }, |
| 615 | + "required": [ |
| 616 | + "hash", |
| 617 | + "startLine", |
| 618 | + "lineCount" |
| 619 | + ] |
| 620 | + }, |
| 621 | + "description": "Contiguous, non-overlapping line ranges ordered by startLine. Each range is attributed to a single commit." |
| 622 | + }, |
| 623 | + "commits": { |
| 624 | + "type": "object", |
| 625 | + "additionalProperties": { |
| 626 | + "type": "object", |
| 627 | + "properties": { |
| 628 | + "hash": { |
| 629 | + "type": "string", |
| 630 | + "description": "The full commit SHA." |
| 631 | + }, |
| 632 | + "date": { |
| 633 | + "type": "string", |
| 634 | + "description": "The commit date in ISO 8601 format." |
| 635 | + }, |
| 636 | + "message": { |
| 637 | + "type": "string", |
| 638 | + "description": "The commit subject line." |
| 639 | + }, |
| 640 | + "authorName": { |
| 641 | + "type": "string" |
| 642 | + }, |
| 643 | + "authorEmail": { |
| 644 | + "type": "string" |
| 645 | + }, |
| 646 | + "previous": { |
| 647 | + "type": "object", |
| 648 | + "properties": { |
| 649 | + "hash": { |
| 650 | + "type": "string", |
| 651 | + "description": "The hash of the commit that previously affected these lines (i.e., the next step backwards in the blame walk)." |
| 652 | + }, |
| 653 | + "path": { |
| 654 | + "type": "string", |
| 655 | + "description": "The file path as it existed at the previous commit. May differ from the current path due to renames." |
| 656 | + } |
| 657 | + }, |
| 658 | + "required": [ |
| 659 | + "hash", |
| 660 | + "path" |
| 661 | + ], |
| 662 | + "description": "Pointer to the previous commit that affected these lines, with the file path as it existed there. Absent when the commit introduced the lines (no earlier history to walk to)." |
| 663 | + } |
| 664 | + }, |
| 665 | + "required": [ |
| 666 | + "hash", |
| 667 | + "date", |
| 668 | + "message", |
| 669 | + "authorName", |
| 670 | + "authorEmail" |
| 671 | + ] |
| 672 | + }, |
| 673 | + "description": "Commit metadata keyed by hash, deduplicated across ranges." |
| 674 | + } |
| 675 | + }, |
| 676 | + "required": [ |
| 677 | + "ranges", |
| 678 | + "commits" |
| 679 | + ] |
| 680 | + }, |
590 | 681 | "PublicGetTreeRequest": { |
591 | 682 | "type": "object", |
592 | 683 | "properties": { |
|
1476 | 1567 | } |
1477 | 1568 | } |
1478 | 1569 | }, |
| 1570 | + "/api/blame": { |
| 1571 | + "get": { |
| 1572 | + "operationId": "getFileBlame", |
| 1573 | + "tags": [ |
| 1574 | + "Git" |
| 1575 | + ], |
| 1576 | + "summary": "Get file blame", |
| 1577 | + "description": "Returns blame information for a file at a given repository path and optional git ref.\n\nThe response is split into two parts:\n- `ranges`: contiguous, non-overlapping line ranges, each attributed to a single commit. Ordered by `startLine`.\n- `commits`: commit metadata (hash, date, message, author, optional `previous` pointer for walking back through history) keyed by hash, deduplicated across ranges.\n\nWhole-file renames are followed automatically. Cross-file line moves and copies are not.", |
| 1578 | + "parameters": [ |
| 1579 | + { |
| 1580 | + "schema": { |
| 1581 | + "type": "string", |
| 1582 | + "description": "The file path to blame, relative to the repository root." |
| 1583 | + }, |
| 1584 | + "required": true, |
| 1585 | + "description": "The file path to blame, relative to the repository root.", |
| 1586 | + "name": "path", |
| 1587 | + "in": "query" |
| 1588 | + }, |
| 1589 | + { |
| 1590 | + "schema": { |
| 1591 | + "type": "string", |
| 1592 | + "description": "The fully-qualified repository name." |
| 1593 | + }, |
| 1594 | + "required": true, |
| 1595 | + "description": "The fully-qualified repository name.", |
| 1596 | + "name": "repo", |
| 1597 | + "in": "query" |
| 1598 | + }, |
| 1599 | + { |
| 1600 | + "schema": { |
| 1601 | + "type": "string", |
| 1602 | + "description": "The git ref (branch, tag, or commit SHA) to blame at. Defaults to the repository's default branch." |
| 1603 | + }, |
| 1604 | + "required": false, |
| 1605 | + "description": "The git ref (branch, tag, or commit SHA) to blame at. Defaults to the repository's default branch.", |
| 1606 | + "name": "ref", |
| 1607 | + "in": "query" |
| 1608 | + } |
| 1609 | + ], |
| 1610 | + "responses": { |
| 1611 | + "200": { |
| 1612 | + "description": "Blame ranges and deduplicated commit metadata.", |
| 1613 | + "content": { |
| 1614 | + "application/json": { |
| 1615 | + "schema": { |
| 1616 | + "$ref": "#/components/schemas/PublicFileBlameResponse" |
| 1617 | + } |
| 1618 | + } |
| 1619 | + } |
| 1620 | + }, |
| 1621 | + "400": { |
| 1622 | + "description": "Invalid query parameters or git ref.", |
| 1623 | + "content": { |
| 1624 | + "application/json": { |
| 1625 | + "schema": { |
| 1626 | + "$ref": "#/components/schemas/PublicApiServiceError" |
| 1627 | + } |
| 1628 | + } |
| 1629 | + } |
| 1630 | + }, |
| 1631 | + "404": { |
| 1632 | + "description": "Repository or file not found.", |
| 1633 | + "content": { |
| 1634 | + "application/json": { |
| 1635 | + "schema": { |
| 1636 | + "$ref": "#/components/schemas/PublicApiServiceError" |
| 1637 | + } |
| 1638 | + } |
| 1639 | + } |
| 1640 | + }, |
| 1641 | + "500": { |
| 1642 | + "description": "Unexpected blame retrieval failure.", |
| 1643 | + "content": { |
| 1644 | + "application/json": { |
| 1645 | + "schema": { |
| 1646 | + "$ref": "#/components/schemas/PublicApiServiceError" |
| 1647 | + } |
| 1648 | + } |
| 1649 | + } |
| 1650 | + } |
| 1651 | + } |
| 1652 | + } |
| 1653 | + }, |
1479 | 1654 | "/api/tree": { |
1480 | 1655 | "post": { |
1481 | 1656 | "operationId": "getFileTree", |
|
0 commit comments