Describe pool management as board-only in OpenAPI

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-05 09:16:35 -05:00
1 parent ad69022cad
commit 6ed022757d
2 files changed
+20

No files matched your search

@@ -227,6 +227,22 @@ function loadSpecRoutes() {
}
describe("openapi routes", () => {
it("documents board-only pool management with revision-checked deletion", () => {
const { spec } = loadSpecRoutes();
const pools = spec.paths["/api/companies/{companyId}/ai-connection-pools"];
const remove = spec.paths["/api/companies/{companyId}/ai-connection-pools/{poolId}"].delete;
const inspection = spec.paths["/api/companies/{companyId}/ai-connection-pools/{poolId}/inspection"].get;
for (const operation of [pools.get, pools.post, remove, inspection]) {
expect(operation.security).toEqual([{ BoardSessionAuth: [] }, { BoardApiKeyAuth: [] }]);
}
expect(remove.requestBody.required).toBe(true);
expect(remove.requestBody.content["application/json"].schema).toMatchObject({
required: ["expectedRevision"], additionalProperties: false,
properties: { expectedRevision: { type: "integer", minimum: 0, exclusiveMinimum: true } },
});
expect(Object.keys(remove.responses)).toEqual(expect.arrayContaining(["200", "400", "401", "403", "404", "409"]));
});
it("documents personal board-only announcements and private responses", () => {
const { spec } = loadSpecRoutes();
const current = spec.paths["/api/announcements/current"].get;
+4
View File
@@ -1352,6 +1352,10 @@ const BOARD_ONLY_OPERATIONS = new Set([
"GET /api/companies/{companyId}/ai-connections/{connectionId}/active-runs",
"GET /api/companies/{companyId}/ai-connections/{connectionId}/usage",
"GET /api/companies/{companyId}/ai-connections/login/{sessionId}",
"GET /api/companies/{companyId}/ai-connection-pools",
"POST /api/companies/{companyId}/ai-connection-pools",
"DELETE /api/companies/{companyId}/ai-connection-pools/{poolId}",
"GET /api/companies/{companyId}/ai-connection-pools/{poolId}/inspection",
"GET /api/companies/{companyId}/project-repositories",
"PUT /api/projects/{id}/repositories",