Skip to content

Node.js based forum software built for the modern web

fix: api tests

Julian Lamb9a61d2d453a
diff --git a/public/openapi/read/uid/uid.yaml b/public/openapi/read/uid/uid.yaml
index 6552e78b9e..dccb23e01a 100644
--- a/public/openapi/read/uid/uid.yaml
+++ b/public/openapi/read/uid/uid.yaml
@@ -8,7 +8,7 @@ get:
For example, to go to `uid` 15's list of topics made, you can navigate to `/api/uid/15/topics`, which will send you to the appropriate canonical URL for that user's topics.
parameters:
- - name: uid
+ - name: uid*
in: path
required: true
schema:
diff --git a/test/api.js b/test/api.js
index c2a78641be..7a00ae3d29 100644
--- a/test/api.js
+++ b/test/api.js
@@ -246,7 +246,7 @@ describe('API', async () => {
return;
}
- const names = (path.match(/{[\w\-_]+}?/g) || []).map(match => match.slice(1, -1));
+ const names = (path.match(/{[\w\-_*]+}?/g) || []).map(match => match.slice(1, -1));
assert(context[method].parameters.map(param => (param.in === 'path' ? param.name : null)).filter(Boolean).every(name => names.includes(name)), `${method.toUpperCase()} ${path} has parameter(s) in path that are not defined in schema`);
});