Skip to content

Commit 34bd1b6

Browse files
prettier fix
1 parent 0f7c74c commit 34bd1b6

File tree

3 files changed

+20
-21
lines changed

3 files changed

+20
-21
lines changed

tools/spectral/ipa/__tests__/getResponseCodeShouldBe200OK.test.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ testRule('xgen-IPA-104-GET-response-code-should-be-200-OK', [
99
'/path1/{resource}': {
1010
get: {
1111
responses: {
12-
'200': {},
13-
'400': {},
14-
'500': {},
12+
200: {},
13+
400: {},
14+
500: {},
1515
},
1616
},
1717
},
1818
'/path2/{resource}': {
1919
get: {
2020
responses: {
21-
'200': {},
22-
'401': {},
23-
'404': {},
21+
200: {},
22+
401: {},
23+
404: {},
2424
},
2525
},
2626
},
@@ -35,17 +35,17 @@ testRule('xgen-IPA-104-GET-response-code-should-be-200-OK', [
3535
'/path1/{resource}': {
3636
get: {
3737
responses: {
38-
'201': {},
39-
'400': {},
40-
'500': {},
38+
201: {},
39+
400: {},
40+
500: {},
4141
},
4242
},
4343
},
4444
'/path2/{resource}': {
4545
get: {
4646
responses: {
47-
'400': {},
48-
'500': {},
47+
400: {},
48+
500: {},
4949
},
5050
},
5151
},
@@ -73,9 +73,9 @@ testRule('xgen-IPA-104-GET-response-code-should-be-200-OK', [
7373
'/path1/{resource}': {
7474
get: {
7575
responses: {
76-
'201': {},
77-
'400': {},
78-
'500': {},
76+
201: {},
77+
400: {},
78+
500: {},
7979
},
8080
},
8181
'x-xgen-IPA-exception': {
@@ -85,8 +85,8 @@ testRule('xgen-IPA-104-GET-response-code-should-be-200-OK', [
8585
'/path2/{resource}': {
8686
get: {
8787
responses: {
88-
'400': {},
89-
'500': {},
88+
400: {},
89+
500: {},
9090
},
9191
},
9292
'x-xgen-IPA-exception': {

tools/spectral/ipa/rulesets/IPA-104.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ rules:
2222
given: '$.paths'
2323
then:
2424
field: '@key'
25-
function: 'getResponseCodeShouldBe200OK'
25+
function: 'getResponseCodeShouldBe200OK'

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const RULE_NAME = 'xgen-IPA-104-GET-response-code-should-be-200-OK';
55
const ERROR_MESSAGE = 'GET method response code should be 200 OK.';
66

77
export default (input, _, { path, documentInventory }) => {
8-
98
const oas = documentInventory.resolved;
109

1110
if (hasException(oas.paths[input], RULE_NAME)) {
@@ -14,13 +13,13 @@ export default (input, _, { path, documentInventory }) => {
1413
}
1514

1615
let pathItem = oas.paths[input];
17-
if(!pathItem.get) {
16+
if (!pathItem.get) {
1817
return;
1918
}
2019

21-
if(pathItem.get && pathItem.get.responses) {
20+
if (pathItem.get && pathItem.get.responses) {
2221
const responses = pathItem.get.responses;
23-
if(!responses['200']) {
22+
if (!responses['200']) {
2423
return collectAndReturnViolation(path, RULE_NAME, ERROR_MESSAGE);
2524
}
2625
}

0 commit comments

Comments
 (0)