mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: normalize paths before comparison
This commit is contained in:
@@ -225,7 +225,7 @@ paths:
|
||||
$ref: 'read/me.yaml'
|
||||
/api/me/*:
|
||||
$ref: 'read/me.yaml'
|
||||
"/api/uid/{uid}/*":
|
||||
"/api/uid/{uid*}":
|
||||
$ref: 'read/uid/uid.yaml'
|
||||
"/api/user/{userslug}":
|
||||
$ref: 'read/user/userslug.yaml'
|
||||
|
||||
@@ -187,7 +187,10 @@ describe('API', async () => {
|
||||
|
||||
return paths;
|
||||
};
|
||||
const paths = buildPaths(webserver.app._router.stack);
|
||||
const paths = buildPaths(webserver.app._router.stack).map(function normalize(pathObj) {
|
||||
pathObj.path = pathObj.path.replace(/\/:([^\\/]+)/g, '/{$1}');
|
||||
return pathObj;
|
||||
});
|
||||
|
||||
// For each express path, query for existence in read and write api schemas
|
||||
paths.forEach((pathObj) => {
|
||||
|
||||
Reference in New Issue
Block a user