Skip to content

Commit

Permalink
Fix Warnings: Generic Object Injection Sink
Browse files Browse the repository at this point in the history
  • Loading branch information
princerajpoot20 committed Sep 9, 2023
1 parent f381db7 commit 7af427c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/controllers/help.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const getPathKeysMatchingCommands = (commands: string[], pathKeys: string[]): st
return pathKeys.find(pathKey => {
const pathParts = pathKey.split('/').filter(part => part !== '');
return pathParts.every((pathPart, i) => {
const command = commands[i];
const command = commands[Number(i)];
return pathPart === command || pathPart.startsWith('{');
});
});
Expand Down Expand Up @@ -70,9 +70,9 @@ export class HelpController implements Controller {
}));
}

const pathInfo = isKeyValid(matchedPathKey, openapiSpec.paths) ? openapiSpec.paths[matchedPathKey] : undefined;
const pathInfo = isKeyValid(matchedPathKey, openapiSpec.paths) ? openapiSpec.paths[String(matchedPathKey)] : undefined;
const method = commands.length > 1 ? 'get' : 'post';
const operationDetails = isKeyValid(method, pathInfo) ? pathInfo[method] : undefined;
const operationDetails = isKeyValid(method, pathInfo) ? pathInfo[String(method)] : undefined;
if (!operationDetails) {
return next(new ProblemException({
type: 'invalid-asyncapi-command',
Expand Down

0 comments on commit 7af427c

Please sign in to comment.