Skip to content

Commit

Permalink
fix: Upgrade dev-dependencies, openapi-ts, and promise-breaker.
Browse files Browse the repository at this point in the history
  • Loading branch information
jwalton committed Oct 17, 2022
1 parent a51da89 commit f886d1b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@types/glob": "^7.1.1",
"@types/json-schema": "^7.0.3",
"@types/lodash": "^4.14.132",
"@types/mocha": "^9.0.0",
"@types/mocha": "^10.0.0",
"@types/node": "^18.7.23",
"@types/pump": "^1.0.1",
"@types/qs": "^6.5.1",
Expand All @@ -62,9 +62,9 @@
"chai-as-promised": "^7.1.1",
"coveralls": "^3.0.2",
"eslint": "^8.3.0",
"husky": "^7.0.4",
"lint-staged": "^12.1.2",
"mocha": "^9.1.3",
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
"mocha": "^10.1.0",
"nyc": "^15.0.0",
"prettier": "^2.0.5",
"pretty-quick": "^3.0.0",
Expand All @@ -85,8 +85,8 @@
"json-ptr": "^3.0.1",
"json-schema-traverse": "^1.0.0",
"lodash": "^4.17.11",
"openapi3-ts": "^2.0.1",
"promise-breaker": "^5.0.0",
"openapi3-ts": "^3.1.1",
"promise-breaker": "^6.0.0",
"pump": "^3.0.0",
"qs": "^6.6.0",
"raw-body": "^2.3.3",
Expand Down
15 changes: 8 additions & 7 deletions src/oas3/Path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Parameter from './Parameter';
import { EXEGESIS_CONTROLLER } from './extensions';

// CONNECT not included, as it is not valid for OpenAPI 3.0.1.
const HTTP_METHODS = ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'OPTIONS', 'TRACE', 'PATCH'];
const HTTP_METHODS = ['get', 'head', 'post', 'put', 'delete', 'options', 'trace', 'patch'] as const;

interface OperationsMap {
[key: string]: Operation;
Expand All @@ -33,19 +33,20 @@ export default class Path {
);

exegesisController = oaPath[EXEGESIS_CONTROLLER] || exegesisController;
this._operations = HTTP_METHODS.map((method) => method.toLowerCase())
.filter((method) => oaPath[method])
.reduce((result: OperationsMap, method: string) => {
this._operations = HTTP_METHODS.reduce((result: OperationsMap, method) => {
const operation = oaPath[method];
if (operation) {
result[method] = new Operation(
context.childContext(method),
oaPath[method],
operation,
oaPath,
method,
exegesisController,
parameters
);
return result;
}, Object.create(null));
}
return result;
}, Object.create(null));
}

getOperation(method: string): Operation | undefined {
Expand Down

0 comments on commit f886d1b

Please sign in to comment.