From 7633f5cf4dad570d66c953f6c66add6828b6d25a Mon Sep 17 00:00:00 2001 From: Monkey Do Date: Wed, 31 Jul 2019 14:21:15 +0200 Subject: [PATCH] Document 406 error for all endpoints --- src/api/routes/author.js | 8 ++++++++ src/api/routes/edition-group.js | 9 ++++++++- src/api/routes/edition.js | 8 ++++++++ src/api/routes/publisher.js | 8 ++++++++ src/api/routes/work.js | 8 ++++++++ 5 files changed, 40 insertions(+), 1 deletion(-) diff --git a/src/api/routes/author.js b/src/api/routes/author.js index c2a34b80b4..6b0c59bbb7 100644 --- a/src/api/routes/author.js +++ b/src/api/routes/author.js @@ -100,6 +100,8 @@ const authorError = 'Author not found'; * $ref: '#/definitions/AuthorDetail' * 404: * description: Author not found + * 406: + * description: Invalid BBID */ router.get('/:bbid', @@ -134,6 +136,8 @@ router.get('/:bbid', * $ref: '#/definitions/Aliases' * 404: * description: Author not found + * 406: + * description: Invalid BBID */ router.get('/:bbid/aliases', @@ -167,6 +171,8 @@ router.get('/:bbid/aliases', * $ref: '#/definitions/Identifiers' * 404: * description: Author not found + * 406: + * description: Invalid BBID */ router.get('/:bbid/identifiers', makeEntityLoader('Author', identifiersRelation, authorError), @@ -199,6 +205,8 @@ router.get('/:bbid/identifiers', * $ref: '#/definitions/Relationships' * 404: * description: Author not found + * 406: + * description: Invalid BBID */ router.get('/:bbid/relationships', diff --git a/src/api/routes/edition-group.js b/src/api/routes/edition-group.js index d705a0ab0d..d793cde0ad 100644 --- a/src/api/routes/edition-group.js +++ b/src/api/routes/edition-group.js @@ -78,7 +78,8 @@ const editionGroupError = 'Edition Group not found'; * $ref: '#/definitions/EditionGroupDetail' * 404: * description: Edition Group not found - * + * 406: + * description: Invalid BBID */ router.get('/:bbid', @@ -112,6 +113,8 @@ router.get('/:bbid', * $ref: '#/definitions/Aliases' * 404: * description: Edition Group not found + * 406: + * description: Invalid BBID */ router.get('/:bbid/aliases', @@ -145,6 +148,8 @@ router.get('/:bbid/aliases', * $ref: '#/definitions/Identifiers' * 404: * description: Edition Group not found + * 406: + * description: Invalid BBID */ router.get('/:bbid/identifiers', @@ -179,6 +184,8 @@ router.get('/:bbid/identifiers', * $ref: '#/definitions/Relationships' * 404: * description: Edition Group not found + * 406: + * description: Invalid BBID */ router.get('/:bbid/relationships', diff --git a/src/api/routes/edition.js b/src/api/routes/edition.js index 541e5c49bd..badd1bee4d 100644 --- a/src/api/routes/edition.js +++ b/src/api/routes/edition.js @@ -113,6 +113,8 @@ const editionError = 'Edition not found'; * $ref: '#/definitions/EditionDetail' * 404: * description: Edition not found + * 406: + * description: Invalid BBID */ @@ -147,6 +149,8 @@ router.get('/:bbid', * $ref: '#/definitions/Aliases' * 404: * description: Edition not found + * 406: + * description: Invalid BBID */ router.get('/:bbid/aliases', @@ -180,6 +184,8 @@ router.get('/:bbid/aliases', * $ref: '#/definitions/Identifiers' * 404: * description: Edition not found + * 406: + * description: Invalid BBID */ router.get('/:bbid/identifiers', @@ -213,6 +219,8 @@ router.get('/:bbid/identifiers', * $ref: '#/definitions/Relationships' * 404: * description: Edition not found + * 406: + * description: Invalid BBID */ router.get('/:bbid/relationships', diff --git a/src/api/routes/publisher.js b/src/api/routes/publisher.js index 59e42b4f51..3a7147abc2 100644 --- a/src/api/routes/publisher.js +++ b/src/api/routes/publisher.js @@ -95,6 +95,8 @@ const publisherError = 'Publisher not found'; * $ref: '#/definitions/PublisherDetail' * 404: * description: Publisher not found + * 406: + * description: Invalid BBID */ router.get('/:bbid', @@ -128,6 +130,8 @@ router.get('/:bbid', * $ref: '#/definitions/Aliases' * 404: * description: Publisher not found + * 406: + * description: Invalid BBID */ router.get('/:bbid/aliases', makeEntityLoader('Publisher', aliasesRelation, publisherError), @@ -160,6 +164,8 @@ router.get('/:bbid/aliases', * $ref: '#/definitions/Identifiers' * 404: * description: Publisher not found + * 406: + * description: Invalid BBID */ router.get('/:bbid/identifiers', @@ -193,6 +199,8 @@ router.get('/:bbid/identifiers', * $ref: '#/definitions/Relationships' * 404: * description: Publisher not found + * 406: + * description: Invalid BBID */ router.get('/:bbid/relationships', diff --git a/src/api/routes/work.js b/src/api/routes/work.js index 099eedd161..8fe00ef371 100644 --- a/src/api/routes/work.js +++ b/src/api/routes/work.js @@ -87,6 +87,8 @@ const workError = 'Work not found'; * $ref: '#/definitions/WorkDetail' * 404: * description: Work not found + * 406: + * description: Invalid BBID */ router.get('/:bbid', @@ -121,6 +123,8 @@ router.get('/:bbid', * $ref: '#/definitions/Aliases' * 404: * description: Work not found + * 406: + * description: Invalid BBID */ @@ -155,6 +159,8 @@ router.get('/:bbid/aliases', * $ref: '#/definitions/Identifiers' * 404: * description: Work not found + * 406: + * description: Invalid BBID */ router.get('/:bbid/identifiers', @@ -189,6 +195,8 @@ router.get('/:bbid/identifiers', * $ref: '#/definitions/Relationships' * 404: * description: Work not found + * 406: + * description: Invalid BBID */ router.get('/:bbid/relationships',