diff options
| author | Mohamed Bassem <me@mbassem.com> | 2025-01-05 12:01:42 +0000 |
|---|---|---|
| committer | Mohamed Bassem <me@mbassem.com> | 2025-01-05 12:01:42 +0000 |
| commit | 1f5d5668b7558ec4d0a77129041cba3ba6d72cb7 (patch) | |
| tree | 547276fbc89d5337c2f32ff6bcb37abe05f5c5dc /packages/open-api/lib | |
| parent | ce16eda75f4d93646e485b7115398e81e7c88acc (diff) | |
| download | karakeep-1f5d5668b7558ec4d0a77129041cba3ba6d72cb7.tar.zst | |
feat: Expose the search functionality in the REST API
Diffstat (limited to 'packages/open-api/lib')
| -rw-r--r-- | packages/open-api/lib/bookmarks.ts | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/packages/open-api/lib/bookmarks.ts b/packages/open-api/lib/bookmarks.ts index 09288a4b..c7c05256 100644 --- a/packages/open-api/lib/bookmarks.ts +++ b/packages/open-api/lib/bookmarks.ts @@ -74,6 +74,32 @@ registry.registerPath({ }); registry.registerPath({ + method: "get", + path: "/bookmarks/search", + description: "Search bookmarks", + summary: "Search bookmarks", + tags: ["Bookmarks"], + security: [{ [BearerAuth.name]: [] }], + request: { + query: z + .object({ + q: z.string(), + }) + .merge(PaginationSchema), + }, + responses: { + 200: { + description: "Object with the search results.", + content: { + "application/json": { + schema: PaginatedBookmarksSchema, + }, + }, + }, + }, +}); + +registry.registerPath({ method: "post", path: "/bookmarks", description: "Create a new bookmark", |
