fix(wikis): refine projectId schema in searchWikiPagesShape
This commit is contained in:
+1
-1
@@ -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
|
||||||
|
|||||||
@@ -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 () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user