From 0188055bbd97c623626e596bcbaf324c8c859bb5 Mon Sep 17 00:00:00 2001 From: JasonLandbridge Date: Tue, 3 Sep 2024 16:53:31 +0200 Subject: [PATCH] split get and delete endpoint --- .../library/[sectionKey]/delete-library.yaml | 15 +++++++++++++++ .../get-library-details.yaml} | 17 ----------------- .../get-library-items.yaml | 0 .../get-search-library.yaml | 0 .../refresh/get-refresh-library-metadata.yaml | 0 src/pms-spec.yaml | 12 ++++++++---- 6 files changed, 23 insertions(+), 21 deletions(-) create mode 100644 src/paths/library/[sectionKey]/delete-library.yaml rename src/paths/library/{[sectionId]/get-and-delete-library-details.yaml => [sectionKey]/get-library-details.yaml} (93%) rename src/paths/library/{[sectionId] => [sectionKey]}/get-library-items.yaml (100%) rename src/paths/library/{[sectionId] => [sectionKey]}/get-search-library.yaml (100%) rename src/paths/library/{[sectionId] => [sectionKey]}/refresh/get-refresh-library-metadata.yaml (100%) diff --git a/src/paths/library/[sectionKey]/delete-library.yaml b/src/paths/library/[sectionKey]/delete-library.yaml new file mode 100644 index 00000000..dfb6e7e1 --- /dev/null +++ b/src/paths/library/[sectionKey]/delete-library.yaml @@ -0,0 +1,15 @@ +delete: + tags: + - Library + summary: Delete Library Section + description: Delete a library using a specific section id + operationId: deleteLibrary + parameters: + - $ref: "../../../parameters/library/section-key.yaml" + responses: + "200": + description: The library is deleted + "400": + $ref: "../../../responses/400.yaml" + "401": + $ref: "../../../responses/401.yaml" diff --git a/src/paths/library/[sectionId]/get-and-delete-library-details.yaml b/src/paths/library/[sectionKey]/get-library-details.yaml similarity index 93% rename from src/paths/library/[sectionId]/get-and-delete-library-details.yaml rename to src/paths/library/[sectionKey]/get-library-details.yaml index f0030d68..45f5e852 100644 --- a/src/paths/library/[sectionId]/get-and-delete-library-details.yaml +++ b/src/paths/library/[sectionKey]/get-library-details.yaml @@ -229,20 +229,3 @@ get: $ref: "../../../responses/400.yaml" "401": $ref: "../../../responses/401.yaml" - -# TODO Move the deleteLibrary operation to its own file, there is currently a bug in the SDKEasy lint that prevents this referencing two methods from the same path url -delete: - tags: - - Library - summary: Delete Library Section - description: Delete a library using a specific section id - operationId: deleteLibrary - parameters: - - $ref: "../../../parameters/library/section-key.yaml" - responses: - "200": - description: The library is deleted - "400": - $ref: "../../../responses/400.yaml" - "401": - $ref: "../../../responses/401.yaml" diff --git a/src/paths/library/[sectionId]/get-library-items.yaml b/src/paths/library/[sectionKey]/get-library-items.yaml similarity index 100% rename from src/paths/library/[sectionId]/get-library-items.yaml rename to src/paths/library/[sectionKey]/get-library-items.yaml diff --git a/src/paths/library/[sectionId]/get-search-library.yaml b/src/paths/library/[sectionKey]/get-search-library.yaml similarity index 100% rename from src/paths/library/[sectionId]/get-search-library.yaml rename to src/paths/library/[sectionKey]/get-search-library.yaml diff --git a/src/paths/library/[sectionId]/refresh/get-refresh-library-metadata.yaml b/src/paths/library/[sectionKey]/refresh/get-refresh-library-metadata.yaml similarity index 100% rename from src/paths/library/[sectionId]/refresh/get-refresh-library-metadata.yaml rename to src/paths/library/[sectionKey]/refresh/get-refresh-library-metadata.yaml diff --git a/src/pms-spec.yaml b/src/pms-spec.yaml index 9d2c3f2e..3913a685 100644 --- a/src/pms-spec.yaml +++ b/src/pms-spec.yaml @@ -119,19 +119,23 @@ paths: $ref: "./paths/library/get-recently-added.yaml" /library/sections: $ref: "./paths/library/get-all-libraries.yaml" + /library/sections/{sectionKey}: - $ref: "./paths/library/[sectionId]/get-and-delete-library-details.yaml" + get: + $ref: "./paths/library/[sectionKey]/get-library-details.yaml#/get" + delete: + $ref: "./paths/library/[sectionKey]/delete-library.yaml#/delete" # Watchlist /library/sections/watchlist/{filter}: $ref: "./paths/library/sections/watchlist/get-watch-list.yaml" /library/sections/{sectionKey}/{tag}: - $ref: "./paths/library/[sectionId]/get-library-items.yaml" + $ref: "./paths/library/[sectionKey]/get-library-items.yaml" /library/sections/{sectionKey}/refresh: - $ref: "./paths/library/[sectionId]/refresh/get-refresh-library-metadata.yaml" + $ref: "./paths/library/[sectionKey]/refresh/get-refresh-library-metadata.yaml" /library/sections/{sectionKey}/search: - $ref: "./paths/library/[sectionId]/get-search-library.yaml" + $ref: "./paths/library/[sectionKey]/get-search-library.yaml" /library/metadata/{ratingKey}: