@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/README.md CHANGED
@@ -28,7 +28,7 @@ references. Further, unused references are skipped to speed up schema
28
28
  compilation in AJV.
29
29
 
30
30
  **Multiple pacts can be compared in one invocation to maximise schema reuse**.
31
- Instead of perforing the comparison per pair of OAS + Pact, we can reuse the
31
+ Instead of performing the comparison per pair of OAS + Pact, we can reuse the
32
32
  compiled OAS schemas across multiple Pacts.
33
33
 
34
34
  **A fast HTTP router is used to match provider routes**. Instead of iterating
package/dist/cli.cjs CHANGED
@@ -11842,6 +11842,10 @@ const minimumSchema = (originalSchema, oas) => {
11842
11842
  if (s.$ref && !refToAdd.includes(s.$ref) && !refAdded.includes(s.$ref)) {
11843
11843
  refToAdd.push(s.$ref);
11844
11844
  }
11845
+ // no-op from a validation perspective
11846
+ if (s.discriminator?.mapping) {
11847
+ delete s.discriminator.mapping;
11848
+ }
11845
11849
  };
11846
11850
  const handleNullableSchema = (s) => {
11847
11851
  if (s.$ref) {
@@ -11867,7 +11871,7 @@ const minimumSchema = (originalSchema, oas) => {
11867
11871
  const ref = refToAdd.shift();
11868
11872
  const path = splitPath(ref);
11869
11873
  refAdded.push(ref);
11870
- const subschema = cloneDeep(get$1(oas, path));
11874
+ const subschema = cloneDeep(get$1(oas, path, {}));
11871
11875
  delete subschema.description;
11872
11876
  delete subschema.example;
11873
11877
  traverse(subschema, collectReferences);
@@ -12513,7 +12517,7 @@ function requireSideChannelList () {
12513
12517
  /** @type {import('./list.d.ts').listGet} */
12514
12518
  var listGet = function (objects, key) {
12515
12519
  if (!objects) {
12516
- return void 0;
12520
+ return void undefined;
12517
12521
  }
12518
12522
  var node = listGetNode(objects, key);
12519
12523
  return node && node.value;
@@ -12566,7 +12570,7 @@ function requireSideChannelList () {
12566
12570
  var root = $o && $o.next;
12567
12571
  var deletedNode = listDelete($o, key);
12568
12572
  if (deletedNode && root && root === deletedNode) {
12569
- $o = void 0;
12573
+ $o = void undefined;
12570
12574
  }
12571
12575
  return !!deletedNode;
12572
12576
  },
@@ -12580,7 +12584,7 @@ function requireSideChannelList () {
12580
12584
  if (!$o) {
12581
12585
  // 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
12582
12586
  $o = {
12583
- next: void 0
12587
+ next: void undefined
12584
12588
  };
12585
12589
  }
12586
12590
  // eslint-disable-next-line no-extra-parens
@@ -13564,7 +13568,7 @@ function requireGetIntrinsic () {
13564
13568
  if (!allowMissing) {
13565
13569
  throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
13566
13570
  }
13567
- return void 0;
13571
+ return void undefined$1;
13568
13572
  }
13569
13573
  if ($gOPD && (i + 1) >= parts.length) {
13570
13574
  var desc = $gOPD(value, part);
@@ -13668,7 +13672,7 @@ function requireSideChannelMap () {
13668
13672
  if ($m) {
13669
13673
  var result = $mapDelete($m, key);
13670
13674
  if ($mapSize($m) === 0) {
13671
- $m = void 0;
13675
+ $m = void undefined;
13672
13676
  }
13673
13677
  return result;
13674
13678
  }
@@ -14197,7 +14201,7 @@ function requireStringify$1 () {
14197
14201
  encodeDotInKeys: false,
14198
14202
  encoder: utils.encode,
14199
14203
  encodeValuesOnly: false,
14200
- filter: void 0,
14204
+ filter: void undefined,
14201
14205
  format: defaultFormat,
14202
14206
  formatter: formats.formatters[defaultFormat],
14203
14207
  // deprecated
@@ -14244,7 +14248,7 @@ function requireStringify$1 () {
14244
14248
  var tmpSc = sideChannel;
14245
14249
  var step = 0;
14246
14250
  var findFlag = false;
14247
- while ((tmpSc = tmpSc.get(sentinel)) !== void 0 && !findFlag) {
14251
+ while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
14248
14252
  // Where object last appeared in the ref tree
14249
14253
  var pos = tmpSc.get(object);
14250
14254
  step += 1;
@@ -14301,7 +14305,7 @@ function requireStringify$1 () {
14301
14305
  if (encodeValuesOnly && encoder) {
14302
14306
  obj = utils.maybeMap(obj, encoder);
14303
14307
  }
14304
- objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void 0 }];
14308
+ objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
14305
14309
  } else if (isArray(filter)) {
14306
14310
  objKeys = filter;
14307
14311
  } else {
@@ -15775,9 +15779,9 @@ function* compareReqSecurity(ajv, route, interaction, index, config) {
15775
15779
  }
15776
15780
  for (const schemeName of Object.keys(scheme)) {
15777
15781
  const scheme = securitySchemes[schemeName];
15778
- switch (scheme?.type) {
15779
- case "apiKey":
15780
- switch (scheme.in) {
15782
+ switch (scheme?.type?.toLowerCase()) {
15783
+ case "apikey":
15784
+ switch (scheme.in.toLowerCase()) {
15781
15785
  case "header":
15782
15786
  if (requestHeaders.has(scheme.name)) {
15783
15787
  isSecured = true;
@@ -15872,7 +15876,7 @@ function* compareReqSecurity(ajv, route, interaction, index, config) {
15872
15876
  isValidSchema = requestHeaders.get("authorization") !== null;
15873
15877
  }
15874
15878
  else {
15875
- switch (scheme.scheme) {
15879
+ switch (scheme.scheme.toLowerCase()) {
15876
15880
  case "basic":
15877
15881
  isValidSchema = auth.toLowerCase().startsWith("basic ");
15878
15882
  break;
@@ -15904,9 +15908,9 @@ function* compareReqSecurity(ajv, route, interaction, index, config) {
15904
15908
  }
15905
15909
  break;
15906
15910
  }
15907
- case "mutualTLS":
15911
+ case "mutualtls":
15908
15912
  case "oauth2":
15909
- case "openIdConnect":
15913
+ case "openidconnect":
15910
15914
  // nothing can be validated, assume meets security requirements
15911
15915
  isSecured = true;
15912
15916
  break;
@@ -32043,7 +32047,7 @@ class Comparator {
32043
32047
  }
32044
32048
  }
32045
32049
 
32046
- var version = "1.4.0";
32050
+ var version = "1.5.1";
32047
32051
  var packageJson = {
32048
32052
  version: version};
32049
32053