@pactflow/openapi-pact-comparator 1.9.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/cli.cjs +26 -16
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +6 -2
- package/dist/index.mjs.map +1 -1
- package/dist/src/utils/config.d.ts +1 -1
- package/package.json +7 -7
package/dist/index.mjs
CHANGED
|
@@ -8126,11 +8126,11 @@ function* compareResBody(ajv, route, interaction, index, config) {
|
|
|
8126
8126
|
};
|
|
8127
8127
|
}
|
|
8128
8128
|
if (response) {
|
|
8129
|
-
const
|
|
8129
|
+
const dereferencedResponse = dereferenceOas(response, oas);
|
|
8130
|
+
const availableResponseContentTypes = operation.produces || Object.keys(dereferencedResponse.content || {});
|
|
8130
8131
|
const contentType = findMatchingType(requestHeaders.get("accept") || DEFAULT_CONTENT_TYPE, availableResponseContentTypes) ||
|
|
8131
8132
|
availableResponseContentTypes[0] ||
|
|
8132
8133
|
DEFAULT_CONTENT_TYPE;
|
|
8133
|
-
const dereferencedResponse = dereferenceOas(response, oas);
|
|
8134
8134
|
const schema = dereferencedResponse?.schema ||
|
|
8135
8135
|
getByContentType(dereferencedResponse.content || {}, contentType)?.schema;
|
|
8136
8136
|
const value = body;
|
|
@@ -19578,6 +19578,8 @@ const DEFAULT_CONFIG = new Map([
|
|
|
19578
19578
|
// SMV casts "[object Object]" queries as objects for validation purposes,
|
|
19579
19579
|
// rather than flag it as a string - suggesting a broken Pact file
|
|
19580
19580
|
["cast-objects-in-pact", quirks],
|
|
19581
|
+
// OPC (like SMV) is case sensitive by default, according to RFC3986
|
|
19582
|
+
["case-insensitive", false],
|
|
19581
19583
|
// SMV didn't support multipart/form-data
|
|
19582
19584
|
["disable-multipart-formdata", quirks],
|
|
19583
19585
|
// SMV ignores duplicate slashes in OAS
|
|
@@ -24264,6 +24266,7 @@ const SUPPORTED_METHODS = [
|
|
|
24264
24266
|
];
|
|
24265
24267
|
function setupRouter(oas, config) {
|
|
24266
24268
|
const router = Router({
|
|
24269
|
+
caseSensitive: !config.get("case-insensitive"),
|
|
24267
24270
|
ignoreDuplicateSlashes: config.get("ignore-duplicate-slashes"),
|
|
24268
24271
|
ignoreTrailingSlash: config.get("ignore-trailing-slash"),
|
|
24269
24272
|
maxParamLength: 2048, // default = 100
|
|
@@ -24276,6 +24279,7 @@ function setupRouter(oas, config) {
|
|
|
24276
24279
|
"";
|
|
24277
24280
|
const path = basePath +
|
|
24278
24281
|
oasPath
|
|
24282
|
+
.replaceAll(":", "::")
|
|
24279
24283
|
.replaceAll(/{.*?}/g, cleanPathParameter)
|
|
24280
24284
|
.replaceAll(/{([.;]?)([^*]+?)\*?}/g, "$1:$2(.+)");
|
|
24281
24285
|
for (const method in oas.paths[oasPath]) {
|