Skip to content

Commit 51cedde

Browse files
address the comments
1 parent 2017cd1 commit 51cedde

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tools/spectral/ipa/rulesets/functions/createMethodRequestBodyIsGetResponse.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { getResponseOfGetMethodByMediaType, isCustomMethodIdentifier } from './utils/resourceEvaluation.js';
22
import { resolveObject } from './utils/componentUtils.js';
3-
import { isEqual, omitDeep } from './utils/compareUtils.js';
3+
import { isDeepEqual, omitDeep } from './utils/compareUtils.js';
44
import { hasException } from './utils/exceptions.js';
55
import { collectAdoption, collectAndReturnViolation, collectException } from './utils/collectionUtils.js';
66

@@ -54,7 +54,7 @@ function checkViolationsAndReturnErrors(
5454

5555
const ignoredValues = opts?.ignoredValues || [];
5656
if (
57-
!isEqual(
57+
!isDeepEqual(
5858
omitDeep(postMethodRequestContentPerMediaType.schema, ...ignoredValues),
5959
omitDeep(getMethodResponseContentPerMediaType.schema, ...ignoredValues)
6060
)

tools/spectral/ipa/rulesets/functions/utils/compareUtils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @param {*} value2 Second value to compare
77
* @returns {boolean} Whether the values are deeply equal
88
*/
9-
export function isEqual(value1, value2) {
9+
export function isDeepEqual(value1, value2) {
1010
// If the values are strictly equal (including handling null/undefined)
1111
if (value1 === value2) return true;
1212

@@ -26,7 +26,7 @@ export function isEqual(value1, value2) {
2626
if (!keys2.includes(key)) return false;
2727

2828
// Recursive equality check for nested objects
29-
if (!isEqual(value1[key], value2[key])) return false;
29+
if (!isDeepEqual(value1[key], value2[key])) return false;
3030
}
3131

3232
return true;

0 commit comments

Comments
 (0)