From eadd8625bf12321fa4bb4a1acc2df402d0cf0a1a Mon Sep 17 00:00:00 2001 From: Luke Hagar Date: Tue, 1 Oct 2024 16:28:58 +0000 Subject: [PATCH] cleaning, formatting, rules --- README.md | 1 + src/paths/butler/task.yaml | 4 ++-- .../library/[sectionKey]/get-library-details.yaml | 2 +- src/paths/library/[sectionKey]/get-library-items.yaml | 2 +- .../refresh/get-refresh-library-metadata.yaml | 2 +- src/paths/library/content-top.yaml | 2 +- src/paths/library/metadata-children.yaml | 11 ++++------- 7 files changed, 11 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 2f1d9f1f..f19ab90f 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ X-Plex-Client-Identifier is typically required, as is X-Plex-Token for authentic - A property in the response is only marked as required if it is always returned, regardless of the parameters sent with the request. - Although Plex.tv API uses the `X-Plex-Token` as a query parameter, this specification will always define this as a header parameter where supported since this follows industry security standards. - Though Plex does default return `XML` unless the `accept` header is set to `application/json`, this specification will not include the `accept` header in the endpoints. Assume it should always be included in the request. +- Parameters added to endpoints via reference should always be specified at the bottom of the paramters set, since there is a large set of common parameters that are used across all endpoints. ## Questions? diff --git a/src/paths/butler/task.yaml b/src/paths/butler/task.yaml index 577f15bc..b8bdd029 100644 --- a/src/paths/butler/task.yaml +++ b/src/paths/butler/task.yaml @@ -35,12 +35,12 @@ post: responses: "200": description: The task was started successfully + "202": + description: The task was already running. "400": $ref: "../../responses/400.yaml" "401": $ref: "../../responses/401.yaml" - "202": - description: The task was already running. delete: tags: diff --git a/src/paths/library/[sectionKey]/get-library-details.yaml b/src/paths/library/[sectionKey]/get-library-details.yaml index 45f5e852..594c6aa5 100644 --- a/src/paths/library/[sectionKey]/get-library-details.yaml +++ b/src/paths/library/[sectionKey]/get-library-details.yaml @@ -45,7 +45,6 @@ get: operationId: get-library-details parameters: - - $ref: "../../../parameters/library/section-key.yaml" - name: includeDetails description: | Whether or not to include details for a section (types, filters, and sorts). @@ -58,6 +57,7 @@ get: - 1 default: 0 required: false + - $ref: "../../../parameters/library/section-key.yaml" responses: "200": description: The details of the library diff --git a/src/paths/library/[sectionKey]/get-library-items.yaml b/src/paths/library/[sectionKey]/get-library-items.yaml index 496fe672..e4e9b78e 100644 --- a/src/paths/library/[sectionKey]/get-library-items.yaml +++ b/src/paths/library/[sectionKey]/get-library-items.yaml @@ -25,7 +25,6 @@ get: - `firstCharacter`: Items categorized by the first letter. - `folder`: Items categorized by folder. parameters: - - $ref: "../../../parameters/library/section-key.yaml" - name: tag in: path required: true @@ -71,6 +70,7 @@ get: required: false schema: $ref: "../../../models/common/PlexMediaType.yaml" + - $ref: "../../../parameters/library/section-key.yaml" - $ref: "../../../parameters/include-meta.yaml" - $ref: "../../../parameters/container-start.yaml" - $ref: "../../../parameters/container-size.yaml" diff --git a/src/paths/library/[sectionKey]/refresh/get-refresh-library-metadata.yaml b/src/paths/library/[sectionKey]/refresh/get-refresh-library-metadata.yaml index 03050732..7f23453b 100644 --- a/src/paths/library/[sectionKey]/refresh/get-refresh-library-metadata.yaml +++ b/src/paths/library/[sectionKey]/refresh/get-refresh-library-metadata.yaml @@ -6,7 +6,6 @@ get: This endpoint Refreshes all the Metadata of the library. operationId: get-refresh-library-metadata parameters: - - $ref: "../../../../parameters/library/section-key.yaml" - name: force description: Force the refresh even if the library is already being refreshed. in: query @@ -17,6 +16,7 @@ get: - 0 - 1 required: false + - $ref: "../../../../parameters/library/section-key.yaml" responses: "200": diff --git a/src/paths/library/content-top.yaml b/src/paths/library/content-top.yaml index d83f5b6d..1d1c8bf6 100644 --- a/src/paths/library/content-top.yaml +++ b/src/paths/library/content-top.yaml @@ -6,7 +6,6 @@ get: This endpoint will return the top watched content from libraries of a certain type operationId: getTopWatchedContent parameters: - - $ref: "../../parameters/type.yaml" - name: includeGuids in: query description: | @@ -15,6 +14,7 @@ get: type: integer required: false example: 1 + - $ref: "../../parameters/type.yaml" responses: "200": description: The metadata of the library item. diff --git a/src/paths/library/metadata-children.yaml b/src/paths/library/metadata-children.yaml index 7cded1b9..e8a39b9f 100644 --- a/src/paths/library/metadata-children.yaml +++ b/src/paths/library/metadata-children.yaml @@ -20,12 +20,9 @@ get: type: string required: false examples: - include-stream: - value: Stream - include-stream-otheritem: - value: Stream,OtherItem - include-stream-otheritem-anotheritem: - value: Stream,OtherItem,AnotherItem + - Stream + - Stream,OtherItem + - Stream,OtherItem,AnotherItem responses: "200": description: The children of the library item. @@ -179,7 +176,7 @@ get: example: Based on"Bad Luck and Trouble," when members of Reacher's old military unit start turning up dead, Reacher has just one thing on his - mind—revenge. + mind-revenge. index: type: integer format: int32