swagger-client 3.19.0 → 3.19.2

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.
@@ -1114,7 +1114,14 @@ function query(_ref2) {
1114
1114
  req.query = req.query || {};
1115
1115
  if (parameter.content) {
1116
1116
  const effectiveMediaType = Object.keys(parameter.content)[0];
1117
- req.query[parameter.name] = (0,_content_serializer_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value, effectiveMediaType);
1117
+ const serializedValue = (0,_content_serializer_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value, effectiveMediaType);
1118
+ if (serializedValue) {
1119
+ req.query[parameter.name] = serializedValue;
1120
+ } else if (parameter.allowEmptyValue && value !== undefined) {
1121
+ const paramName = parameter.name;
1122
+ req.query[paramName] = req.query[paramName] || {};
1123
+ req.query[paramName].allowEmptyValue = true;
1124
+ }
1118
1125
  return;
1119
1126
  }
1120
1127
  if (value === false) {
@@ -1824,7 +1831,7 @@ const isOpenAPI30 = spec => {
1824
1831
  const {
1825
1832
  openapi
1826
1833
  } = spec;
1827
- return typeof openapi === 'string' && openapi.startsWith('3.0');
1834
+ return typeof openapi === 'string' && /^3\.0\.([0123])(?:-rc[012])?$/.test(openapi);
1828
1835
  } catch {
1829
1836
  return false;
1830
1837
  }
@@ -1834,7 +1841,7 @@ const isOpenAPI31 = spec => {
1834
1841
  const {
1835
1842
  openapi
1836
1843
  } = spec;
1837
- return typeof openapi === 'string' && openapi.startsWith('3.1');
1844
+ return typeof openapi === 'string' && /^3\.1\.(?:[1-9]\d*|0)$/.test(openapi);
1838
1845
  } catch {
1839
1846
  return false;
1840
1847
  }
@@ -16558,7 +16565,6 @@ var arrayPrefixGenerators = {
16558
16565
  };
16559
16566
 
16560
16567
  var isArray = Array.isArray;
16561
- var split = String.prototype.split;
16562
16568
  var push = Array.prototype.push;
16563
16569
  var pushToArray = function (arr, valueOrArray) {
16564
16570
  push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
@@ -16660,14 +16666,6 @@ var stringify = function stringify(
16660
16666
  if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
16661
16667
  if (encoder) {
16662
16668
  var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);
16663
- if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
16664
- var valuesArray = split.call(String(obj), ',');
16665
- var valuesJoined = '';
16666
- for (var i = 0; i < valuesArray.length; ++i) {
16667
- valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format));
16668
- }
16669
- return [formatter(keyValue) + (commaRoundTrip && isArray(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];
16670
- }
16671
16669
  return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
16672
16670
  }
16673
16671
  return [formatter(prefix) + '=' + formatter(String(obj))];
@@ -16682,6 +16680,9 @@ var stringify = function stringify(
16682
16680
  var objKeys;
16683
16681
  if (generateArrayPrefix === 'comma' && isArray(obj)) {
16684
16682
  // we need to join elements in
16683
+ if (encodeValuesOnly && encoder) {
16684
+ obj = utils.maybeMap(obj, encoder);
16685
+ }
16685
16686
  objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
16686
16687
  } else if (isArray(filter)) {
16687
16688
  objKeys = filter;
@@ -16714,7 +16715,7 @@ var stringify = function stringify(
16714
16715
  commaRoundTrip,
16715
16716
  strictNullHandling,
16716
16717
  skipNulls,
16717
- encoder,
16718
+ generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,
16718
16719
  filter,
16719
16720
  sort,
16720
16721
  allowDots,