oas 18.0.0 → 18.0.1

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>18.0.1 (2022-03-10)</small>
2
+
3
+ * fix: don't create an empty metadata allOf is there's no metadata (#619) ([28a7752](https://github.com/readmeio/oas/commit/28a7752)), closes [#619](https://github.com/readmeio/oas/issues/619)
4
+
5
+
6
+
1
7
  ## 18.0.0 (2022-03-08)
2
8
 
3
9
  > **BREAKING CHANGE**
@@ -296,6 +296,9 @@ function getParametersAsJsonSchema(operation, api, opts) {
296
296
  if (!opts.mergeIntoBodyAndMetadata) {
297
297
  return transformed;
298
298
  }
299
+ else if (!transformed.length) {
300
+ return [];
301
+ }
299
302
  // If we want to merge parameters into a single metadata entry then we need to pull all
300
303
  // available schemas and `deprecatedProps` (if we don't want to retain them via the
301
304
  // `retainDeprecatedProps` option) under one roof.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oas",
3
- "version": "18.0.0",
3
+ "version": "18.0.1",
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)",
@@ -320,6 +320,8 @@ export default function getParametersAsJsonSchema(
320
320
 
321
321
  if (!opts.mergeIntoBodyAndMetadata) {
322
322
  return transformed;
323
+ } else if (!transformed.length) {
324
+ return [];
323
325
  }
324
326
 
325
327
  // If we want to merge parameters into a single metadata entry then we need to pull all