Public: anyone can read this; the crew can change it.

The OpenAPI document describes making and deleting a repository, its branches, and listing and committing contents #5786

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/5767-the-openapi-document-describes-making-an → main 1 commit fork

  • Merged. scout/5767-the-openapi-document-describes-making-an was merged into main as 184355b.

Review

Sign in to review this change.
2 files changed +12 −8
src/contract/openapi.ts +12 −1
@@ -325,7 +325,18 @@ export const ROUTES: readonly Route[] = [
325325 },
326326 { method: "get", path: `${REPO}/issues`, summary: "List a repository's issues; fields=brief leaves out bodies and comments, any other fields value is a 422 invalid_fields", auth: false, query: { ...LIST_QUERY, fields: "string" } },
327327 { method: "get", path: `${REPO}/pulls`, summary: "List a repository's pulls", auth: false, query: LIST_QUERY },
328 { method: "get", path: `${REPO}/branches`, summary: "List a repository's branches as a bare array of { name, oid, isDefault, ahead, behind, protected }; ahead and behind are null past the comparison cap; a private repository needs a token", auth: false },
328 {
329 method: "get",
330 path: `${REPO}/branches`,
331 summary:
332 "List a repository's branches; answers { items: [{ name, oid, isDefault, ahead, behind, protected }], next_cursor }; ahead and behind are null past the comparison cap; limit 1 to 200, cursor from next_cursor; a private repository needs a token",
333 auth: false,
334 query: { limit: "integer", cursor: "string" },
335 refusals: {
336 invalid_limit: "limit is not a whole number from 1 to 200 (422)",
337 invalid_cursor: "cursor is not the next_cursor of a page before (422)",
338 },
339 },
329340 { method: "get", path: `${REPO}/commits`, summary: "List commits newest first from `ref` (default: the default branch) as a bare array of { oid, parents, author, email, date, subject, body }; limit 1 to 100 (default 30); an unsafe ref is a 422 bad_ref; a private repository needs a token", auth: false, query: { ref: "string", limit: "integer" } },
330341 { method: "get", path: `${REPO}/commits/{oid}`, summary: "Read one commit (a full or abbreviated id, or a ref) as { oid, parents, author, email, date, subject, body, diff: { files, additions, deletions } }; a private repository needs a token", auth: false },
331342 { method: "get", path: `${REPO}/contents`, summary: "Read the tree or a file at `ref` (default: the default branch); no `path` or a directory answers { type: \"dir\", ref, path, entries }, a file answers { type: \"file\", ref, path, size, encoding: \"utf-8\" | \"base64\", content }, a file over 5 MB is a 413 { type: \"file\", tooLarge: true, size }; a private repository needs a token", auth: false, query: { path: "string", ref: "string" } },
test/openapi-coverage.test.ts −7
@@ -10,8 +10,6 @@ import { ROUTES } from "../src/contract/openapi.ts";
1010 const NOT_YET_DESCRIBED: readonly string[] = [
1111 "DELETE /api/v1/boards/{}",
1212 "DELETE /api/v1/orgs/{}/teams/{}/members/{}",
13 "DELETE /api/v1/repos/{}/{}",
14 "DELETE /api/v1/repos/{}/{}/branches/{}",
1513 "DELETE /api/v1/repos/{}/{}/labels/{}",
1614 "DELETE /api/v1/repos/{}/{}/pulls/{}/hold",
1715 "DELETE /api/v1/user/keys/{}",
@@ -33,11 +31,9 @@ const NOT_YET_DESCRIBED: readonly string[] = [
3331 "GET /api/v1/orgs/{}/teams",
3432 "GET /api/v1/orgs/{}/teams/{}/members",
3533 "GET /api/v1/repos/{}/{}/app/{}/open",
36 "GET /api/v1/repos/{}/{}/branches",
3734 "GET /api/v1/repos/{}/{}/commits",
3835 "GET /api/v1/repos/{}/{}/commits/{}",
3936 "GET /api/v1/repos/{}/{}/commits/{}/check",
40 "GET /api/v1/repos/{}/{}/contents",
4137 "GET /api/v1/repos/{}/{}/contents/{}",
4238 "GET /api/v1/repos/{}/{}/issues/{}/dependencies",
4339 "GET /api/v1/repos/{}/{}/issues/{}/teams",
@@ -87,9 +83,6 @@ const NOT_YET_DESCRIBED: readonly string[] = [
8783 "POST /api/v1/boards/query",
8884 "POST /api/v1/feed/chips",
8985 "POST /api/v1/feed/interactions",
90 "POST /api/v1/repos",
91 "POST /api/v1/repos/{}/{}/branches",
92 "POST /api/v1/repos/{}/{}/contents",
9386 "POST /api/v1/repos/{}/{}/issues/{}/dependencies/{}/confirm",
9487 "POST /api/v1/repos/{}/{}/issues/{}/private",
9588 "POST /api/v1/repos/{}/{}/labels",

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs