Skip to content

Commit 16a5ca0

Browse files
committed
Address OpenAPI PR review feedback
Remove the localhost servers entry, clarify the SSE stream description, point docs readers at /api/openapi.json, add the changelog entry, and update the lockfile metadata.
1 parent 17a49a9 commit 16a5ca0

File tree

6 files changed

+8
-20
lines changed

6 files changed

+8
-20
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Changed
1111
- Require explicit invocation of ask_codebase tool in MCP [#995](https://github.com/sourcebot-dev/sourcebot/pull/995)
1212
- Gate MCP API behind authentication when Ask GitHub is enabled. [#994](https://github.com/sourcebot-dev/sourcebot/pull/994)
13+
- Added generated OpenAPI documentation for the public search, repo, and file browsing API surface. [#101](https://github.com/sourcebot-dev/sourcebot/issues/101)
1314

1415
## [4.15.4] - 2026-03-11
1516

docs/api-reference/sourcebot-public.openapi.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,9 @@
22
"openapi": "3.0.3",
33
"info": {
44
"title": "Sourcebot Public API",
5-
"version": "v4.15.2",
5+
"version": "v4.15.4",
66
"description": "OpenAPI description for the public Sourcebot REST endpoints used for search, repository listing, and file browsing."
77
},
8-
"servers": [
9-
{
10-
"url": "http://localhost:3000",
11-
"description": "Local development web app"
12-
}
13-
],
148
"tags": [
159
{
1610
"name": "Search",
@@ -443,7 +437,7 @@
443437
},
444438
"PublicStreamSearchSse": {
445439
"type": "string",
446-
"description": "Server-sent event stream. Each data frame contains one JSON object matching PublicStreamedSearchEvent.",
440+
"description": "Server-sent event stream. Each data frame contains one JSON object representing either a chunk update, a final summary, or an error.",
447441
"example": "data: {\"type\":\"chunk\",\"stats\":{\"actualMatchCount\":1}}\n\n"
448442
},
449443
"PublicRepository": {

docs/docs/api-reference/overview.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ title: API Reference
33
sidebarTitle: API Reference
44
---
55

6-
Sourcebot exposes a public REST API for code search, repository listing, and file browsing.
6+
You can fetch the OpenAPI document for your Sourcebot instance from `/api/openapi.json`.
77

8-
The endpoint reference in this section is generated from the web app's Zod schemas and OpenAPI registry, then rendered by Mintlify from [`api-reference/sourcebot-public.openapi.json`](/api-reference/sourcebot-public.openapi.json).
8+
This API reference is generated from the web app's Zod schemas and OpenAPI registry. Mintlify renders it from the checked-in spec at [`/api-reference/sourcebot-public.openapi.json`](/api-reference/sourcebot-public.openapi.json).
99

10-
The first documented surface includes:
10+
The first documented endpoints include:
1111

1212
- `/api/search`
1313
- `/api/stream_search`
@@ -17,7 +17,7 @@ The first documented surface includes:
1717
- `/api/tree`
1818
- `/api/files`
1919

20-
To refresh the spec after changing those contracts:
20+
To refresh the spec after you change those contracts:
2121

2222
```bash
2323
yarn openapi:generate

packages/web/src/openapi/publicApiDocument.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,6 @@ export function createPublicOpenApiDocument(version: string) {
229229
version,
230230
description: 'OpenAPI description for the public Sourcebot REST endpoints used for search, repository listing, and file browsing.',
231231
},
232-
servers: [
233-
{
234-
url: 'http://localhost:3000',
235-
description: 'Local development web app',
236-
},
237-
],
238232
tags: [searchTag, reposTag, filesTag, miscTag],
239233
});
240234

packages/web/src/openapi/publicApiSchemas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@ export const publicListReposQuerySchema = z.object({
7171
export const publicListReposResponseSchema = z.array(publicRepositorySchema).openapi('PublicListReposResponse');
7272

7373
export const publicStreamSearchSseSchema = z.string().openapi('PublicStreamSearchSse', {
74-
description: 'Server-sent event stream. Each data frame contains one JSON object matching PublicStreamedSearchEvent.',
74+
description: 'Server-sent event stream. Each data frame contains one JSON object representing either a chunk update, a final summary, or an error.',
7575
example: 'data: {"type":"chunk","stats":{"actualMatchCount":1}}\n\n',
7676
});

yarn.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8699,7 +8699,6 @@ __metadata:
86998699
version: 0.0.0-use.local
87008700
resolution: "@sourcebot/backend@workspace:packages/backend"
87018701
dependencies:
8702-
"@asteasolutions/zod-to-openapi": "npm:7.3.4"
87038702
"@coderabbitai/bitbucket": "npm:^1.1.3"
87048703
"@gitbeaker/rest": "npm:^40.5.1"
87058704
"@octokit/app": "npm:^16.1.1"

0 commit comments

Comments
 (0)