diff options
| author | Mohamed Bassem <me@mbassem.com> | 2024-12-27 21:54:31 +0000 |
|---|---|---|
| committer | Mohamed Bassem <me@mbassem.com> | 2024-12-27 21:54:31 +0000 |
| commit | 7b6f87668bf80026730e65d08c976c8a39b5092c (patch) | |
| tree | 60dcfe931b5090cf0f26afb2bf3bd8faf8fc1747 /packages/open-api/hoarder-openapi-spec.json | |
| parent | 3f56389f55ef116f8cea17c15c684798fb942290 (diff) | |
| download | karakeep-7b6f87668bf80026730e65d08c976c8a39b5092c.tar.zst | |
docs: Fix missing docs for highlights APIs
Diffstat (limited to 'packages/open-api/hoarder-openapi-spec.json')
| -rw-r--r-- | packages/open-api/hoarder-openapi-spec.json | 255 |
1 files changed, 255 insertions, 0 deletions
diff --git a/packages/open-api/hoarder-openapi-spec.json b/packages/open-api/hoarder-openapi-spec.json index 26f0a4b7..fcd0fb77 100644 --- a/packages/open-api/hoarder-openapi-spec.json +++ b/packages/open-api/hoarder-openapi-spec.json @@ -37,6 +37,10 @@ "type": "string", "example": "ieidlxygmwj87oxz5hxttoc8" }, + "HighlightId": { + "type": "string", + "example": "ieidlxygmwj87oxz5hxttoc8" + }, "Bookmark": { "type": "object", "properties": { @@ -397,6 +401,25 @@ "numBookmarks", "numBookmarksByAttachedType" ] + }, + "PaginatedHighlights": { + "type": "object", + "properties": { + "highlights": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Highlight" + } + }, + "nextCursor": { + "type": "string", + "nullable": true + } + }, + "required": [ + "highlights", + "nextCursor" + ] } }, "parameters": { @@ -423,6 +446,14 @@ "required": true, "name": "tagId", "in": "path" + }, + "HighlightId": { + "schema": { + "$ref": "#/components/schemas/HighlightId" + }, + "required": true, + "name": "highlightId", + "in": "path" } } }, @@ -1439,6 +1470,230 @@ } } } + }, + "/highlights": { + "get": { + "description": "Get all highlights", + "summary": "Get all highlights", + "tags": [ + "Highlights" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "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 all highlights data.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaginatedHighlights" + } + } + } + } + } + }, + "post": { + "description": "Create a new highlight", + "summary": "Create a new highlight", + "tags": [ + "Highlights" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "requestBody": { + "description": "The highlight to create", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "bookmarkId": { + "type": "string" + }, + "startOffset": { + "type": "number" + }, + "endOffset": { + "type": "number" + }, + "color": { + "type": "string", + "enum": [ + "yellow", + "red", + "green", + "blue" + ], + "default": "yellow" + }, + "text": { + "type": "string", + "nullable": true + }, + "note": { + "type": "string", + "nullable": true + } + }, + "required": [ + "bookmarkId", + "startOffset", + "endOffset", + "text", + "note" + ] + } + } + } + }, + "responses": { + "201": { + "description": "The created highlight", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Highlight" + } + } + } + } + } + } + }, + "/highlights/{highlightId}": { + "get": { + "description": "Get highlight by its id", + "summary": "Get a single highlight", + "tags": [ + "Highlights" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/HighlightId" + } + ], + "responses": { + "200": { + "description": "Object with highlight data.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Highlight" + } + } + } + } + } + }, + "delete": { + "description": "Delete highlight by its id", + "summary": "Delete a highlight", + "tags": [ + "Highlights" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/HighlightId" + } + ], + "responses": { + "200": { + "description": "The deleted highlight", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Highlight" + } + } + } + } + } + }, + "patch": { + "description": "Update highlight by its id", + "summary": "Update a highlight", + "tags": [ + "Highlights" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/HighlightId" + } + ], + "requestBody": { + "description": "The data to update. Only the fields you want to update need to be provided.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "color": { + "type": "string", + "enum": [ + "yellow", + "red", + "green", + "blue" + ] + } + } + } + } + } + }, + "responses": { + "200": { + "description": "The updated highlight", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Highlight" + } + } + } + } + } + } } } }
\ No newline at end of file |
