mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-12 02:23:12 +01:00
feat(openapi): schema validation for write api definitions file
This commit is contained in:
14
test/api.js
14
test/api.js
@@ -235,6 +235,18 @@ describe('Read API', async () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('Write API', () => {
|
||||
describe('Write API', async () => {
|
||||
let writeApi;
|
||||
const apiPath = path.resolve(__dirname, '../public/openapi/write.yaml');
|
||||
|
||||
it('should pass OpenAPI v3 validation', async () => {
|
||||
try {
|
||||
await SwaggerParser.validate(apiPath);
|
||||
} catch (e) {
|
||||
assert.ifError(e);
|
||||
}
|
||||
});
|
||||
|
||||
// writeApi = await SwaggerParser.dereference(apiPath);
|
||||
// console.log(writeApi);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user