@readme/oas-to-har 17.0.4 → 17.0.5

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.0.5 (2022-05-20)</small>
2
+
3
+ * fix: add handling for when `requestBody` is present w/o a `schema` (#89) ([d8911e0](https://github.com/readmeio/oas-to-har/commit/d8911e0)), closes [#89](https://github.com/readmeio/oas-to-har/issues/89)
4
+
5
+
6
+
1
7
  ## <small>17.0.4 (2022-05-04)</small>
2
8
 
3
9
  * fix: more quirks with handling RAW_BODY primitives (#88) ([9f421cd](https://github.com/readmeio/oas-to-har/commit/9f421cd)), closes [#88](https://github.com/readmeio/oas-to-har/issues/88)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@readme/oas-to-har",
3
3
  "description": "Utility to transform an OAS operation into a HAR representation",
4
- "version": "17.0.4",
4
+ "version": "17.0.5",
5
5
  "main": "src/index.js",
6
6
  "author": "Jon Ursenbach <jon@ursenba.ch>",
7
7
  "license": "ISC",
package/src/index.js CHANGED
@@ -447,7 +447,10 @@ module.exports = (
447
447
  // Add a `Content-Type` header if there are any body values setup above or if there is a schema
448
448
  // defined, but only do so if we don't already have a `Content-Type` present as it's impossible
449
449
  // for a request to have multiple.
450
- if ((har.postData.text || (requestBody && Object.keys(requestBody.schema).length)) && !hasContentType) {
450
+ if (
451
+ (har.postData.text || (requestBody && requestBody.schema && Object.keys(requestBody.schema).length)) &&
452
+ !hasContentType
453
+ ) {
451
454
  har.headers.push({
452
455
  name: 'Content-Type',
453
456
  value: contentType,