From e8797ce0c80d2992ba9000a04dd6dcd296e6b496 Mon Sep 17 00:00:00 2001 From: Nicholas Wallace Date: Wed, 15 May 2024 04:18:29 +0000 Subject: [PATCH] Replace: generic parameter with path specific parameter --- docs/controllers/AuthorController.yaml | 37 ++++++++++++++----------- docs/controllers/LibraryController.yaml | 15 ++++------ 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/docs/controllers/AuthorController.yaml b/docs/controllers/AuthorController.yaml index 1016ab1e5..9a8f54e82 100644 --- a/docs/controllers/AuthorController.yaml +++ b/docs/controllers/AuthorController.yaml @@ -117,14 +117,6 @@ components: schema: type: boolean default: false - parameters: - authorId: - name: id - in: path - description: Author ID - required: true - schema: - $ref: '../objects/entities/Author.yaml#/components/schemas/authorId' responses: author200: description: Author found. @@ -141,14 +133,19 @@ components: example: Author not found. paths: /api/authors/{id}: + parameters: + - name: id + in: path + description: Author ID + required: true + schema: + $ref: '../objects/entities/Author.yaml#/components/schemas/authorId' get: operationId: getAuthorById summary: Get an author by ID description: Get an author by ID. The author's books and series can be included in the response. tags: - Authors - parameters: - $ref: '#/components/parameters/authorId' requestBody: $ref: '#/components/requestBody/authorInclude' $ref: '#/components/requestBody/authorLibraryId' @@ -205,14 +202,19 @@ paths: '404': $ref: '#/components/responses/author404' /api/authors/{id}/image: + parameters: + - name: id + in: path + description: Author ID + required: true + schema: + $ref: '../objects/entities/Author.yaml#/components/schemas/authorId' get: operationId: getAuthorImageById summary: Get an author image by author ID description: Get an author image by author ID. The image will be returned in the requested format and size. tags: - Authors - parameters: - $ref: '#/components/parameters/authorId' requestBody: $ref: '#/components/requestBody/imageWidth' $ref: '#/components/requestBody/imageHeight' @@ -287,22 +289,25 @@ paths: description: Delete an author image by author ID. This will remove the image from the server and the database. tags: - Authors - parameters: - $ref: '#/components/parameters/authorId' responses: '200': description: deleteAuthorImageById OK '404': $ref: '#/components/responses/author404' /api/authors/{id}/match: + parameters: + - name: id + in: path + description: Author ID + required: true + schema: + $ref: '../objects/entities/Author.yaml#/components/schemas/authorId' post: operationId: matchAuthorById summary: Match the author against Audible using quick match description: Match the author against Audible using quick match. Quick match updates the author's description and image (if no image already existed) with information from audible. Either `asin` or `q` must be provided, with `asin` taking priority if both are provided. tags: - Authors - parameters: - $ref: '#/components/parameters/authorId' requestBody: $ref: '#/components/requestBody/asin' $ref: '#/components/requestBody/authorSearchName' diff --git a/docs/controllers/LibraryController.yaml b/docs/controllers/LibraryController.yaml index da8df4961..72b0b2f96 100644 --- a/docs/controllers/LibraryController.yaml +++ b/docs/controllers/LibraryController.yaml @@ -1,12 +1,4 @@ components: - parameters: - libraryId: - name: id - in: path - description: The ID of the library. - required: true - schema: - $ref: '../objects/Library.yaml#/components/schemas/libraryId' requestBody: libraryName: name: name @@ -133,7 +125,12 @@ paths: $ref: '#/components/responses/library404' /api/libraries/{id}: parameters: - $ref: '#/components/parameters/libraryId' + - name: id + in: path + description: The ID of the library. + required: true + schema: + $ref: '../objects/Library.yaml#/components/schemas/libraryId' get: operationId: getLibraryById summary: Get a single library by ID on server