diff --git a/package-lock.json b/package-lock.json index 3a302e388..7bfec1520 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@prettier/plugin-php": "^0.22.2", "@prettier/plugin-ruby": "^4.0.4", "@seamapi/blueprint": "^0.40.1", - "@seamapi/types": "1.384.0", + "@seamapi/types": "1.386.0", "change-case": "^5.4.4", "command-exists": "^1.2.9", "del": "^8.0.0", @@ -781,9 +781,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.384.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.384.0.tgz", - "integrity": "sha512-pFQF4O7LaLu9J2yfNxtiuN/kCYX5WH0Sdccx6BC1rYQqwQSD1m5/yXTq14iCBa6z2R8Fw09WRU5Zp+NjHtleQQ==", + "version": "1.386.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.386.0.tgz", + "integrity": "sha512-K3nG7nWbYVOZTv7ZgP6mFssC08tVCQ95Cg52GSj9AMwsfW8sFl4jZl9JZlpVjlo07/CI1t22ZpSRkJWD408COA==", "license": "MIT", "engines": { "node": ">=18.12.0", diff --git a/package.json b/package.json index 605e5dfe4..0d818a5b4 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "@prettier/plugin-php": "^0.22.2", "@prettier/plugin-ruby": "^4.0.4", "@seamapi/blueprint": "^0.40.1", - "@seamapi/types": "1.384.0", + "@seamapi/types": "1.386.0", "change-case": "^5.4.4", "command-exists": "^1.2.9", "del": "^8.0.0", diff --git a/src/lib/report.ts b/src/lib/report.ts index 4dd29a18f..ab414d770 100644 --- a/src/lib/report.ts +++ b/src/lib/report.ts @@ -320,17 +320,21 @@ function processResponseKeys(endpoint: Endpoint, report: Report): void { function getOpenapiResponseProperties( path: string, -): Record | undefined { +): Record | undefined | null { const openapiEndpointDef = openapi.paths[path as keyof typeof openapi.paths] if (openapiEndpointDef == null) { // eslint-disable-next-line no-console console.warn(`OpenAPI definition not found for endpoint: ${path}`) - return + return null } - return openapiEndpointDef.post.responses['200']?.content['application/json'] - ?.schema?.properties + const res = openapiEndpointDef.post.responses['200'] + if ('content' in res) { + return res.content['application/json']?.schema?.properties + } + + return null } function processParameters(