Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial version of the OpenApi schema-validation-wrapper
- Loading branch information
1 parent
7bcbc48
commit 7595d7b
Showing
3 changed files
with
126 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* To validate OpenApi schemas we need more than just the schemas produced | ||
* by sequelize-to-any-json-schema. This skeleton provides the surrounding | ||
* schema required to pass validation (where `components/schemas` will be | ||
* filled with the content provided by the OpenApi6Strategy produced schema. | ||
* | ||
* Please note that we also need to set the root key (e.g. `users`) | ||
*/ | ||
|
||
module.exports = Object.freeze({ | ||
openapi: '3.0.2', | ||
info: { | ||
title: 'Fake API', | ||
description: 'Dummy output for testing schemas generated by sequelize-to-any-json-schema', | ||
version: '0.0.1', | ||
}, | ||
paths: { | ||
'/users': { | ||
get: { | ||
parameters: [], | ||
responses: { | ||
'404': { | ||
description: 'not found', | ||
}, | ||
}, | ||
description: 'Retrieves a list of all users from the API.', | ||
summary: '', | ||
tags: ['users'], | ||
security: [], | ||
}, | ||
}, | ||
}, | ||
components: { | ||
schemas: {}, | ||
}, | ||
tags: [ | ||
{ | ||
name: 'users', | ||
description: 'A users service', | ||
}, | ||
], | ||
}); |