oas 17.4.2 → 17.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## <small>17.4.3 (2022-01-05)</small>
2
+
3
+ * fix(operation): support operations without responses (#576) ([67ec319](https://github.com/readmeio/oas/commit/67ec319)), closes [#576](https://github.com/readmeio/oas/issues/576)
4
+
5
+
6
+
1
7
  ## <small>17.4.2 (2022-01-05)</small>
2
8
 
3
9
  * fix: callbacks not having path-level data to retrieve common summaries (#575) ([c7d1144](https://github.com/readmeio/oas/commit/c7d1144)), closes [#575](https://github.com/readmeio/oas/issues/575)
package/dist/operation.js CHANGED
@@ -240,14 +240,16 @@ var Operation = /** @class */ (function () {
240
240
  })
241
241
  .filter(function (p) { return p; }));
242
242
  }
243
- this.headers.response = Object.keys(this.schema.responses)
244
- // Remove the reference object because we will have already dereferenced
245
- .filter(function (r) { return _this.schema.responses[r].headers; })
246
- .map(function (r) {
247
- // Remove the reference object because we will have already dereferenced
248
- return Object.keys(_this.schema.responses[r].headers);
249
- })
250
- .reduce(function (a, b) { return a.concat(b); }, []);
243
+ if (this.schema.responses) {
244
+ this.headers.response = Object.keys(this.schema.responses)
245
+ // Remove the reference object because we will have already dereferenced
246
+ .filter(function (r) { return _this.schema.responses[r].headers; })
247
+ .map(function (r) {
248
+ // Remove the reference object because we will have already dereferenced
249
+ return Object.keys(_this.schema.responses[r].headers);
250
+ })
251
+ .reduce(function (a, b) { return a.concat(b); }, []);
252
+ }
251
253
  // If the operation doesn't already specify a 'content-type' request header,
252
254
  // we check if the path operation request body contains content, which implies that
253
255
  // we should also include the 'content-type' header.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oas",
3
- "version": "17.4.2",
3
+ "version": "17.4.3",
4
4
  "description": "Working with OpenAPI definitions is hard. This makes it easier.",
5
5
  "license": "MIT",
6
6
  "author": "ReadMe <support@readme.io> (https://readme.com)",
package/src/operation.ts CHANGED
@@ -272,14 +272,16 @@ export default class Operation {
272
272
  );
273
273
  }
274
274
 
275
- this.headers.response = Object.keys(this.schema.responses)
276
- // Remove the reference object because we will have already dereferenced
277
- .filter(r => (this.schema.responses[r] as RMOAS.ResponseObject).headers)
278
- .map(r =>
275
+ if (this.schema.responses) {
276
+ this.headers.response = Object.keys(this.schema.responses)
279
277
  // Remove the reference object because we will have already dereferenced
280
- Object.keys((this.schema.responses[r] as RMOAS.ResponseObject).headers)
281
- )
282
- .reduce((a, b) => a.concat(b), []);
278
+ .filter(r => (this.schema.responses[r] as RMOAS.ResponseObject).headers)
279
+ .map(r =>
280
+ // Remove the reference object because we will have already dereferenced
281
+ Object.keys((this.schema.responses[r] as RMOAS.ResponseObject).headers)
282
+ )
283
+ .reduce((a, b) => a.concat(b), []);
284
+ }
283
285
 
284
286
  // If the operation doesn't already specify a 'content-type' request header,
285
287
  // we check if the path operation request body contains content, which implies that