From b5ed9cb57c43330a18b1f0a0c9909f2a16dec37c Mon Sep 17 00:00:00 2001 From: Tobias Kabbeck Date: Wed, 21 Aug 2024 15:41:38 +0200 Subject: [PATCH 1/2] ZO-4493: add merkl bookmarks, merkl categories and teaser endpoint --- docs/api/api.yaml | 192 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 192 insertions(+) diff --git a/docs/api/api.yaml b/docs/api/api.yaml index 139d3c3..e7c6dca 100644 --- a/docs/api/api.yaml +++ b/docs/api/api.yaml @@ -23,6 +23,170 @@ servers: - "0.3.1" paths: + /teaser/{uuid}: + get: + security: + - cookieAuthProduction: [] + - cookieAuthStaging: [] + description: Returns a single teaser element + parameters: + - in: path + name: uuid + required: true + schema: + $ref: "#/components/schemas/UUID" + responses: + "200": + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/CenterpageTeaser" + - $ref: "#/components/schemas/CenterpageTeaserVideo" + - $ref: "#/components/schemas/CenterpageTeaserPodcast" + - $ref: "#/components/schemas/CenterpageTeaserAudio" + description: "Success" + "400": + description: "Something was wrong. Check the body for error messages." + "401": + description: "Unauthorized to get teaser" + "404": + description: "Not found" + "503": + description: "Service unavailable" + + /merkl/bookmarks: + get: + security: + - cookieAuthProduction: [] + - cookieAuthStaging: [] + description: + Returns list of bookmarks, optionally filtered by category.
+ Calling this endpoint without parameters returns all bookmarks.
+ To get only bookmarks by a given category, call this endpoint with the `category` parameter. + parameters: + - in: query + name: category + required: false + schema: + type: string + description: Category + example: "podcast" + description: category to filter list of bookmarks + example: "?category=podcast" + tags: + - bookmarks + responses: + "200": + content: + application/json: + schema: + anyOf: + - $ref: "#/components/schemas/BOOKMARK" + - $ref: "#/components/schemas/CATEGORY" + description: "Success" + "400": + description: "Something was wrong with the request to get bookmarks. Check the body for error messages." + "401": + description: "Unauthorized to get bookmarks" + "503": + description: "Service unavailable to get bookmarks" + post: + security: + - cookieAuthProduction: [] + - cookieAuthStaging: [] + operationId: postBookmark + description: Add a new bookmark + tags: + - bookmarks + requestBody: + description: Adds the given UUID at bookmarklist + required: true + content: + application/json: + schema: + type: object + properties: + uuid: + $ref: "#/components/schemas/UUID" + responses: + "201": + description: "Saved entry to bookmarks (201)" + "204": + description: "Saved entry to bookmarks (204)" + "400": + description: "Something was wrong with the request. Check the body for error messages." + "401": + description: "Unauthorized" + "403": + description: "Forbidden" + "502": + description: "Bad gateway" + "503": + description: "Service unavailable" + delete: + security: + - cookieAuthProduction: [] + - cookieAuthStaging: [] + operationId: deleteRpcBookmark + description: + Delete one or all bookmarks:
+ delete one bookmark: If you want to delete one specific bookmark/UUID,
+ you have to set its UUID as a parameters.
+ delete all bookmarks: To delete all bookmarks, call this endpoint without parameters. + tags: + - bookmarks + parameters: + - in: query + name: uuid + required: false + schema: + $ref: "#/components/schemas/UUIDFILTER" + description: UUID of an article + responses: + "204": + description: "Deleted entry from bookmarks or delete all bookmarks, respectively" + "400": + description: "Something was wrong with the request to delete a bookmark. Check the body for error messages." + "401": + description: "Unauthorized to delete a bookmark" + "403": + description: "Forbidden from deleting a bookmark" + "502": + description: "Bad gateway to delete a bookmark" + "503": + description: "Service unavailable for deleting bookmarks" + + /merkl/categories: + get: + security: + - cookieAuthProduction: [] + - cookieAuthStaging: [] + summary: "Returns the bookmark categories" + tags: + - categories + responses: + "200": + content: + application/json: + schema: + type: array + items: + type: object + properties: + ssoid: + type: integer + example: 54 + uuid: + $ref: "#/components/schemas/UUID" + description: "Success getting categories" + "400": + description: "Something was wrong with the request to get categories. Check the body for error messages." + "401": + description: "Unauthorized to get categories" + "503": + description: "Service unavailable for getting categories" + /bookmarks: get: security: @@ -542,6 +706,34 @@ components: items: $ref: "#/components/schemas/UUID" + UUIDFILTER: + type: string + pattern: ^[eq\.]+(([a-f0-9]{8})(-[a-f0-9]{4}){3}(-[a-f0-9]{12})\\}?|[-a-z0-9/]+)$ + description: Postgrest equal filter function + example: "eq.d995ba5a-a7fb-401a-bdc8-86cf2cbf0cda" + + BOOKMARK: + type: array + description: Describes a bookmark item + items: + type: object + properties: + created: + type: string + example: "2022-11-25T16:18:37.124812+00:00" + ssoid: + type: integer + example: 42 + uuid: + $ref: "#/components/schemas/UUID" + + CATEGORY: + description: Describes a filtered list of UUIDs + type: array + items: + type: string + example: "d995ba5a-a7fb-401a-bdc8-86cf2cbf0cda" + BookmarkIds: type: object items: From e2b863bd8d4a9d3715ef5afbb0b63f79c5209963 Mon Sep 17 00:00:00 2001 From: Andreas Zeidler Date: Mon, 2 Sep 2024 09:13:48 +0200 Subject: [PATCH 2/2] style: apply minor case and white space cosmetics --- docs/api/api.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/api/api.yaml b/docs/api/api.yaml index e7c6dca..505ce1d 100644 --- a/docs/api/api.yaml +++ b/docs/api/api.yaml @@ -54,7 +54,7 @@ paths: description: "Not found" "503": description: "Service unavailable" - + /merkl/bookmarks: get: security: @@ -82,8 +82,8 @@ paths: application/json: schema: anyOf: - - $ref: "#/components/schemas/BOOKMARK" - - $ref: "#/components/schemas/CATEGORY" + - $ref: "#/components/schemas/Bookmark" + - $ref: "#/components/schemas/Category" description: "Success" "400": description: "Something was wrong with the request to get bookmarks. Check the body for error messages." @@ -94,7 +94,7 @@ paths: post: security: - cookieAuthProduction: [] - - cookieAuthStaging: [] + - cookieAuthStaging: [] operationId: postBookmark description: Add a new bookmark tags: @@ -141,7 +141,7 @@ paths: name: uuid required: false schema: - $ref: "#/components/schemas/UUIDFILTER" + $ref: "#/components/schemas/UUIDFilter" description: UUID of an article responses: "204": @@ -221,7 +221,7 @@ paths: type: object properties: id: - $ref: "#/components/schemas/UUID" + $ref: "#/components/schemas/UUID" responses: "201": description: "Saved entry to bookmarks" @@ -706,13 +706,13 @@ components: items: $ref: "#/components/schemas/UUID" - UUIDFILTER: + UUIDFilter: type: string pattern: ^[eq\.]+(([a-f0-9]{8})(-[a-f0-9]{4}){3}(-[a-f0-9]{12})\\}?|[-a-z0-9/]+)$ description: Postgrest equal filter function example: "eq.d995ba5a-a7fb-401a-bdc8-86cf2cbf0cda" - BOOKMARK: + Bookmark: type: array description: Describes a bookmark item items: @@ -727,7 +727,7 @@ components: uuid: $ref: "#/components/schemas/UUID" - CATEGORY: + Category: description: Describes a filtered list of UUIDs type: array items: