Skip to content

Commit 044ed0a

Browse files
Fix: List method checks (#624)
1 parent c8d48ad commit 044ed0a

9 files changed

+9
-8
lines changed

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export default [
3232
enforceForLogicalOperands: true,
3333
},
3434
],
35+
'no-mixed-operators': 'warn',
3536
},
3637
},
3738
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default (input, _, { path, documentInventory }) => {
1515

1616
if (
1717
!isResourceCollectionIdentifier(resourcePath) ||
18-
(isResourceCollectionIdentifier(resourcePath) && isSingletonResource(getResourcePathItems(resourcePath, oas.paths)))
18+
isSingletonResource(getResourcePathItems(resourcePath, oas.paths))
1919
) {
2020
return;
2121
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default (input, _, { path, documentInventory }) => {
2626
if (
2727
!mediaType.endsWith('json') ||
2828
!isResourceCollectionIdentifier(resourcePath) ||
29-
(isResourceCollectionIdentifier(resourcePath) && isSingletonResource(getResourcePathItems(resourcePath, oas.paths)))
29+
isSingletonResource(getResourcePathItems(resourcePath, oas.paths))
3030
) {
3131
return;
3232
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default (input, _, { path, documentInventory }) => {
1717

1818
if (
1919
!isResourceCollectionIdentifier(resourcePath) ||
20-
(isResourceCollectionIdentifier(resourcePath) && isSingletonResource(getResourcePathItems(resourcePath, oas.paths)))
20+
isSingletonResource(getResourcePathItems(resourcePath, oas.paths))
2121
) {
2222
return;
2323
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default (input, _, { path, documentInventory }) => {
2525
if (
2626
!mediaType.endsWith('json') ||
2727
!isResourceCollectionIdentifier(resourcePath) ||
28-
(isResourceCollectionIdentifier(resourcePath) && isSingletonResource(getResourcePathItems(resourcePath, oas.paths)))
28+
isSingletonResource(getResourcePathItems(resourcePath, oas.paths))
2929
) {
3030
return;
3131
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default (input, _, { path, documentInventory }) => {
1515

1616
if (
1717
!isResourceCollectionIdentifier(resourcePath) ||
18-
(isResourceCollectionIdentifier(resourcePath) && isSingletonResource(getResourcePathItems(resourcePath, oas.paths)))
18+
isSingletonResource(getResourcePathItems(resourcePath, oas.paths))
1919
) {
2020
return;
2121
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default (input, _, { path, documentInventory }) => {
1515

1616
if (
1717
!isResourceCollectionIdentifier(resourcePath) ||
18-
(isResourceCollectionIdentifier(resourcePath) && isSingletonResource(getResourcePathItems(resourcePath, oas.paths)))
18+
isSingletonResource(getResourcePathItems(resourcePath, oas.paths))
1919
) {
2020
return;
2121
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default (input, _, { path, documentInventory }) => {
2424
if (
2525
!mediaType.endsWith('json') ||
2626
!isResourceCollectionIdentifier(resourcePath) ||
27-
(isResourceCollectionIdentifier(resourcePath) && isSingletonResource(getResourcePathItems(resourcePath, oas.paths)))
27+
isSingletonResource(getResourcePathItems(resourcePath, oas.paths))
2828
) {
2929
return;
3030
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default (input, _, { path, documentInventory }) => {
2424
if (
2525
!mediaType.endsWith('json') ||
2626
!isResourceCollectionIdentifier(resourcePath) ||
27-
(isResourceCollectionIdentifier(resourcePath) && isSingletonResource(getResourcePathItems(resourcePath, oas.paths)))
27+
isSingletonResource(getResourcePathItems(resourcePath, oas.paths))
2828
) {
2929
return;
3030
}

0 commit comments

Comments
 (0)