@pactflow/openapi-pact-comparator 1.10.0 → 1.11.0

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
@@ -8128,11 +8128,11 @@ function* compareResBody(ajv, route, interaction, index, config) {
8128
8128
  };
8129
8129
  }
8130
8130
  if (response) {
8131
- const availableResponseContentTypes = operation.produces || Object.keys(response.content || {});
8131
+ const dereferencedResponse = dereferenceOas(response, oas);
8132
+ const availableResponseContentTypes = operation.produces || Object.keys(dereferencedResponse.content || {});
8132
8133
  const contentType = findMatchingType(requestHeaders.get("accept") || DEFAULT_CONTENT_TYPE, availableResponseContentTypes) ||
8133
8134
  availableResponseContentTypes[0] ||
8134
8135
  DEFAULT_CONTENT_TYPE;
8135
- const dereferencedResponse = dereferenceOas(response, oas);
8136
8136
  const schema = dereferencedResponse?.schema ||
8137
8137
  getByContentType(dereferencedResponse.content || {}, contentType)?.schema;
8138
8138
  const value = body;
@@ -19580,6 +19580,8 @@ const DEFAULT_CONFIG = new Map([
19580
19580
  // SMV casts "[object Object]" queries as objects for validation purposes,
19581
19581
  // rather than flag it as a string - suggesting a broken Pact file
19582
19582
  ["cast-objects-in-pact", quirks],
19583
+ // OPC (like SMV) is case sensitive by default, according to RFC3986
19584
+ ["case-insensitive", false],
19583
19585
  // SMV didn't support multipart/form-data
19584
19586
  ["disable-multipart-formdata", quirks],
19585
19587
  // SMV ignores duplicate slashes in OAS
@@ -24266,6 +24268,7 @@ const SUPPORTED_METHODS = [
24266
24268
  ];
24267
24269
  function setupRouter(oas, config) {
24268
24270
  const router = Router({
24271
+ caseSensitive: !config.get("case-insensitive"),
24269
24272
  ignoreDuplicateSlashes: config.get("ignore-duplicate-slashes"),
24270
24273
  ignoreTrailingSlash: config.get("ignore-trailing-slash"),
24271
24274
  maxParamLength: 2048, // default = 100