diff options
Diffstat (limited to 'packages/open-api')
| -rw-r--r-- | packages/open-api/hoarder-openapi-spec.json | 52 | ||||
| -rw-r--r-- | packages/open-api/lib/bookmarks.ts | 26 |
2 files changed, 78 insertions, 0 deletions
diff --git a/packages/open-api/hoarder-openapi-spec.json b/packages/open-api/hoarder-openapi-spec.json index 92088f48..7b2b9436 100644 --- a/packages/open-api/hoarder-openapi-spec.json +++ b/packages/open-api/hoarder-openapi-spec.json @@ -679,6 +679,58 @@ } } }, + "/bookmarks/search": { + "get": { + "description": "Search bookmarks", + "summary": "Search bookmarks", + "tags": [ + "Bookmarks" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "schema": { + "type": "string" + }, + "required": true, + "name": "q", + "in": "query" + }, + { + "schema": { + "type": "number" + }, + "required": false, + "name": "limit", + "in": "query" + }, + { + "schema": { + "$ref": "#/components/schemas/Cursor" + }, + "required": false, + "name": "cursor", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Object with the search results.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaginatedBookmarks" + } + } + } + } + } + } + }, "/bookmarks/{bookmarkId}": { "get": { "description": "Get bookmark by its id", 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", |
