You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(validator): address review feedback for content negotiation
Allow failure() to preserve matchedPath so coverage tracking works for
matched endpoints even on validation failures.
Add docblocks to isJsonContentType() and isContentTypeInSpec() with
preconditions. Clarify content negotiation comment to document the
intentional asymmetry between JSON and non-JSON type matching.
Narrow catch(Throwable) to catch(JsonException) in extractJsonBody()
to avoid masking unrelated errors.
"Response Content-Type '{$normalizedType}' is not defined for {$method}{$matchedPath} (status {$statusCode}) in '{$specName}' spec. Defined content types: {$defined}",
89
-
]);
90
+
], $matchedPath);
90
91
}
91
92
92
93
// JSON-compatible response: fall through to existing JSON schema validation.
94
+
// JSON types are treated as interchangeable (e.g. application/vnd.api+json
95
+
// validates against an application/json spec entry) because the schema is
96
+
// the same regardless of the specific JSON media type.
0 commit comments