fix(wikis): refine projectId schema in searchWikiPagesShape

This commit is contained in:
Lucas Winther
2026-09-07 02:51:46 +02:00
parent 16e54614ac
commit 2fb25a9604
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ export const searchWikiPagesShape = {
.optional() .optional()
.describe("Substring keyword to match in wiki page title"), .describe("Substring keyword to match in wiki page title"),
projectId: z projectId: z
.union([z.string(), z.number()]) .union([z.number().int().positive(), z.string().min(1)])
.optional() .optional()
.describe("Project ID or identifier to scope search"), .describe("Project ID or identifier to scope search"),
limit: z limit: z
+3
View File
@@ -1549,6 +1549,9 @@ describe("Wikis Tools", () => {
expect(() => schema.parse({ limit: 0 })).toThrow(); expect(() => schema.parse({ limit: 0 })).toThrow();
expect(() => schema.parse({ limit: -5 })).toThrow(); expect(() => schema.parse({ limit: -5 })).toThrow();
expect(() => schema.parse({ limit: 150 })).toThrow(); expect(() => schema.parse({ limit: 150 })).toThrow();
expect(() => schema.parse({ projectId: "" })).toThrow();
expect(() => schema.parse({ projectId: 0 })).toThrow();
expect(() => schema.parse({ projectId: -1 })).toThrow();
}); });
test("handleSearchWikiPages catches errors and returns error response", async () => { test("handleSearchWikiPages catches errors and returns error response", async () => {