Skip to content

Node.js based forum software built for the modern web

feat(openapi): schema validation for write api definitions file

Julian Lam87e3f26fe4a1
diff --git a/test/api.js b/test/api.js
index 15e3fded31..b1330ece5b 100644
--- a/test/api.js
+++ b/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);
});