@pactflow/openapi-pact-comparator 1.4.0 → 1.5.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/dist/index.cjs CHANGED
@@ -3678,6 +3678,10 @@ const minimumSchema = (originalSchema, oas) => {
3678
3678
  if (s.$ref && !refToAdd.includes(s.$ref) && !refAdded.includes(s.$ref)) {
3679
3679
  refToAdd.push(s.$ref);
3680
3680
  }
3681
+ // no-op from a validation perspective
3682
+ if (s.discriminator?.mapping) {
3683
+ delete s.discriminator.mapping;
3684
+ }
3681
3685
  };
3682
3686
  const handleNullableSchema = (s) => {
3683
3687
  if (s.$ref) {
@@ -3703,7 +3707,7 @@ const minimumSchema = (originalSchema, oas) => {
3703
3707
  const ref = refToAdd.shift();
3704
3708
  const path = splitPath(ref);
3705
3709
  refAdded.push(ref);
3706
- const subschema = cloneDeep(get$1(oas, path));
3710
+ const subschema = cloneDeep(get$1(oas, path, {}));
3707
3711
  delete subschema.description;
3708
3712
  delete subschema.example;
3709
3713
  traverse(subschema, collectReferences);
@@ -4355,7 +4359,7 @@ function requireSideChannelList () {
4355
4359
  /** @type {import('./list.d.ts').listGet} */
4356
4360
  var listGet = function (objects, key) {
4357
4361
  if (!objects) {
4358
- return void 0;
4362
+ return void undefined;
4359
4363
  }
4360
4364
  var node = listGetNode(objects, key);
4361
4365
  return node && node.value;
@@ -4408,7 +4412,7 @@ function requireSideChannelList () {
4408
4412
  var root = $o && $o.next;
4409
4413
  var deletedNode = listDelete($o, key);
4410
4414
  if (deletedNode && root && root === deletedNode) {
4411
- $o = void 0;
4415
+ $o = void undefined;
4412
4416
  }
4413
4417
  return !!deletedNode;
4414
4418
  },
@@ -4422,7 +4426,7 @@ function requireSideChannelList () {
4422
4426
  if (!$o) {
4423
4427
  // Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head
4424
4428
  $o = {
4425
- next: void 0
4429
+ next: void undefined
4426
4430
  };
4427
4431
  }
4428
4432
  // eslint-disable-next-line no-extra-parens
@@ -5406,7 +5410,7 @@ function requireGetIntrinsic () {
5406
5410
  if (!allowMissing) {
5407
5411
  throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
5408
5412
  }
5409
- return void 0;
5413
+ return void undefined$1;
5410
5414
  }
5411
5415
  if ($gOPD && (i + 1) >= parts.length) {
5412
5416
  var desc = $gOPD(value, part);
@@ -5510,7 +5514,7 @@ function requireSideChannelMap () {
5510
5514
  if ($m) {
5511
5515
  var result = $mapDelete($m, key);
5512
5516
  if ($mapSize($m) === 0) {
5513
- $m = void 0;
5517
+ $m = void undefined;
5514
5518
  }
5515
5519
  return result;
5516
5520
  }
@@ -6039,7 +6043,7 @@ function requireStringify$1 () {
6039
6043
  encodeDotInKeys: false,
6040
6044
  encoder: utils.encode,
6041
6045
  encodeValuesOnly: false,
6042
- filter: void 0,
6046
+ filter: void undefined,
6043
6047
  format: defaultFormat,
6044
6048
  formatter: formats.formatters[defaultFormat],
6045
6049
  // deprecated
@@ -6086,7 +6090,7 @@ function requireStringify$1 () {
6086
6090
  var tmpSc = sideChannel;
6087
6091
  var step = 0;
6088
6092
  var findFlag = false;
6089
- while ((tmpSc = tmpSc.get(sentinel)) !== void 0 && !findFlag) {
6093
+ while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
6090
6094
  // Where object last appeared in the ref tree
6091
6095
  var pos = tmpSc.get(object);
6092
6096
  step += 1;
@@ -6143,7 +6147,7 @@ function requireStringify$1 () {
6143
6147
  if (encodeValuesOnly && encoder) {
6144
6148
  obj = utils.maybeMap(obj, encoder);
6145
6149
  }
6146
- objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void 0 }];
6150
+ objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
6147
6151
  } else if (isArray(filter)) {
6148
6152
  objKeys = filter;
6149
6153
  } else {
@@ -7617,9 +7621,9 @@ function* compareReqSecurity(ajv, route, interaction, index, config) {
7617
7621
  }
7618
7622
  for (const schemeName of Object.keys(scheme)) {
7619
7623
  const scheme = securitySchemes[schemeName];
7620
- switch (scheme?.type) {
7621
- case "apiKey":
7622
- switch (scheme.in) {
7624
+ switch (scheme?.type?.toLowerCase()) {
7625
+ case "apikey":
7626
+ switch (scheme.in.toLowerCase()) {
7623
7627
  case "header":
7624
7628
  if (requestHeaders.has(scheme.name)) {
7625
7629
  isSecured = true;
@@ -7714,7 +7718,7 @@ function* compareReqSecurity(ajv, route, interaction, index, config) {
7714
7718
  isValidSchema = requestHeaders.get("authorization") !== null;
7715
7719
  }
7716
7720
  else {
7717
- switch (scheme.scheme) {
7721
+ switch (scheme.scheme.toLowerCase()) {
7718
7722
  case "basic":
7719
7723
  isValidSchema = auth.toLowerCase().startsWith("basic ");
7720
7724
  break;
@@ -7746,9 +7750,9 @@ function* compareReqSecurity(ajv, route, interaction, index, config) {
7746
7750
  }
7747
7751
  break;
7748
7752
  }
7749
- case "mutualTLS":
7753
+ case "mutualtls":
7750
7754
  case "oauth2":
7751
- case "openIdConnect":
7755
+ case "openidconnect":
7752
7756
  // nothing can be validated, assume meets security requirements
7753
7757
  isSecured = true;
7754
7758
  break;