Skip to content

Commit

Permalink
Document 406 error for all endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
MonkeyDo committed Jul 31, 2019
1 parent 22ee080 commit 7633f5c
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/api/routes/author.js
Expand Up @@ -100,6 +100,8 @@ const authorError = 'Author not found';
* $ref: '#/definitions/AuthorDetail'
* 404:
* description: Author not found
* 406:
* description: Invalid BBID
*/

router.get('/:bbid',
Expand Down Expand Up @@ -134,6 +136,8 @@ router.get('/:bbid',
* $ref: '#/definitions/Aliases'
* 404:
* description: Author not found
* 406:
* description: Invalid BBID
*/

router.get('/:bbid/aliases',
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -199,6 +205,8 @@ router.get('/:bbid/identifiers',
* $ref: '#/definitions/Relationships'
* 404:
* description: Author not found
* 406:
* description: Invalid BBID
*/

router.get('/:bbid/relationships',
Expand Down
9 changes: 8 additions & 1 deletion src/api/routes/edition-group.js
Expand Up @@ -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',
Expand Down Expand Up @@ -112,6 +113,8 @@ router.get('/:bbid',
* $ref: '#/definitions/Aliases'
* 404:
* description: Edition Group not found
* 406:
* description: Invalid BBID
*/

router.get('/:bbid/aliases',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down
8 changes: 8 additions & 0 deletions src/api/routes/edition.js
Expand Up @@ -113,6 +113,8 @@ const editionError = 'Edition not found';
* $ref: '#/definitions/EditionDetail'
* 404:
* description: Edition not found
* 406:
* description: Invalid BBID
*/


Expand Down Expand Up @@ -147,6 +149,8 @@ router.get('/:bbid',
* $ref: '#/definitions/Aliases'
* 404:
* description: Edition not found
* 406:
* description: Invalid BBID
*/

router.get('/:bbid/aliases',
Expand Down Expand Up @@ -180,6 +184,8 @@ router.get('/:bbid/aliases',
* $ref: '#/definitions/Identifiers'
* 404:
* description: Edition not found
* 406:
* description: Invalid BBID
*/

router.get('/:bbid/identifiers',
Expand Down Expand Up @@ -213,6 +219,8 @@ router.get('/:bbid/identifiers',
* $ref: '#/definitions/Relationships'
* 404:
* description: Edition not found
* 406:
* description: Invalid BBID
*/

router.get('/:bbid/relationships',
Expand Down
8 changes: 8 additions & 0 deletions src/api/routes/publisher.js
Expand Up @@ -95,6 +95,8 @@ const publisherError = 'Publisher not found';
* $ref: '#/definitions/PublisherDetail'
* 404:
* description: Publisher not found
* 406:
* description: Invalid BBID
*/

router.get('/:bbid',
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -160,6 +164,8 @@ router.get('/:bbid/aliases',
* $ref: '#/definitions/Identifiers'
* 404:
* description: Publisher not found
* 406:
* description: Invalid BBID
*/

router.get('/:bbid/identifiers',
Expand Down Expand Up @@ -193,6 +199,8 @@ router.get('/:bbid/identifiers',
* $ref: '#/definitions/Relationships'
* 404:
* description: Publisher not found
* 406:
* description: Invalid BBID
*/

router.get('/:bbid/relationships',
Expand Down
8 changes: 8 additions & 0 deletions src/api/routes/work.js
Expand Up @@ -87,6 +87,8 @@ const workError = 'Work not found';
* $ref: '#/definitions/WorkDetail'
* 404:
* description: Work not found
* 406:
* description: Invalid BBID
*/

router.get('/:bbid',
Expand Down Expand Up @@ -121,6 +123,8 @@ router.get('/:bbid',
* $ref: '#/definitions/Aliases'
* 404:
* description: Work not found
* 406:
* description: Invalid BBID
*/


Expand Down Expand Up @@ -155,6 +159,8 @@ router.get('/:bbid/aliases',
* $ref: '#/definitions/Identifiers'
* 404:
* description: Work not found
* 406:
* description: Invalid BBID
*/

router.get('/:bbid/identifiers',
Expand Down Expand Up @@ -189,6 +195,8 @@ router.get('/:bbid/identifiers',
* $ref: '#/definitions/Relationships'
* 404:
* description: Work not found
* 406:
* description: Invalid BBID
*/

router.get('/:bbid/relationships',
Expand Down

0 comments on commit 7633f5c

Please sign in to comment.