mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-28 01:21:13 +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;
|
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