From 37d029e01a2760ca8221a811efbf7ebf90a9b873 Mon Sep 17 00:00:00 2001 From: Nicholas Wallace Date: Sun, 19 May 2024 01:33:00 +0000 Subject: [PATCH] Add: author search region for matching --- docs/controllers/AuthorController.yaml | 2 ++ docs/openapi.json | 31 +++++++++++++++++++------- docs/schemas.yaml | 5 +++++ 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/docs/controllers/AuthorController.yaml b/docs/controllers/AuthorController.yaml index 0522340b1..1106a0892 100644 --- a/docs/controllers/AuthorController.yaml +++ b/docs/controllers/AuthorController.yaml @@ -279,6 +279,8 @@ paths: $ref: '#/components/schemas/authorSearchName' asin: $ref: '../objects/entities/Author.yaml#/components/schemas/authorAsin' + region: + $ref: '../schemas.yaml#/components/schemas/region' responses: '200': description: matchAuthorById OK diff --git a/docs/openapi.json b/docs/openapi.json index eb2b54f95..3b94c9039 100644 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -357,14 +357,18 @@ "content": { "application/json": { "schema": { - "oneOf": [ - { + "type": "object", + "properties": { + "q": { + "$ref": "#/components/schemas/authorSearchName" + }, + "asin": { "$ref": "#/components/schemas/authorAsin" }, - { - "$ref": "#/components/schemas/authorSearchName" + "region": { + "$ref": "#/components/schemas/region" } - ] + } } } } @@ -591,9 +595,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/authorExpanded" + "type": "object", + "properties": { + "authors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/authorExpanded" + } + } } } } @@ -1348,6 +1357,12 @@ "type": "string", "example": "Terry Goodkind" }, + "region": { + "description": "The region used to search.", + "type": "string", + "example": "us", + "default": "us" + }, "libraryName": { "description": "The name of the library.", "type": "string", diff --git a/docs/schemas.yaml b/docs/schemas.yaml index 3002b1c3a..6b371892f 100644 --- a/docs/schemas.yaml +++ b/docs/schemas.yaml @@ -55,3 +55,8 @@ components: type: boolean example: true default: false + region: + description: The region used to search. + type: string + example: 'us' + default: 'us'