equinor / equinor/openapi-flattener
POST operation without a request body failing
- Dominant language
- JavaScript
- Stars
- 9
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
I have an API that is defined that has a POST method but no request body and I'm seeing the following error.
```
/home/workspace/.npm/_npx/cb83394c13646cfe/node_modules/openapi-flattener/dist/flattener.js:36
var bodySchema = (_a = requestBody.content['application/json']) === null || _a === void 0 ? void 0 : _a.schema;
^
TypeError: Cannot read properties of undefined (reading 'content')
at mergeRequestBody (/home/dell/.npm/_npx/cb83394c13646cfe/node_modules/openapi-flattener/dist/flattener.js:36:40)
at /home/dell/.npm/_npx/cb83394c13646cfe/node_modules/openapi-flattener/dist/flattener.js:66:17
at Array.forEach ()
at /home/dell/.npm/_npx/cb83394c13646cfe/node_modules/openapi-flattener/dist/flattener.js:51:47
at /home/dell/.npm/_npx/cb83394c13646cfe/node_modules/call-me-maybe/src/maybe.js:9:28
at processTicksAndRejections (node:internal/process/task_queues:78:11)
```
Contributor guide
Assessment
This issue has not been assessed yet.