11import testRule from './__helpers__/testRule' ;
22import { DiagnosticSeverity } from '@stoplight/types' ;
33
4- testRule ( 'xgen-IPA-107-put-method-response-code-is-200' , [
4+ // Put
5+ testRule ( 'xgen-IPA-107-update-method-response-code-is-200' , [
56 {
67 name : 'valid methods' ,
78 document : {
@@ -72,28 +73,28 @@ testRule('xgen-IPA-107-put-method-response-code-is-200', [
7273 } ,
7374 errors : [
7475 {
75- code : 'xgen-IPA-107-put -method-response-code-is-200' ,
76+ code : 'xgen-IPA-107-update -method-response-code-is-200' ,
7677 message :
7778 'The Update method response status code should be 200 OK. This method either lacks a 200 OK response or defines a different 2xx status code.' ,
7879 path : [ 'paths' , '/resourceOne/{id}' , 'put' ] ,
7980 severity : DiagnosticSeverity . Warning ,
8081 } ,
8182 {
82- code : 'xgen-IPA-107-put -method-response-code-is-200' ,
83+ code : 'xgen-IPA-107-update -method-response-code-is-200' ,
8384 message :
8485 'The Update method response status code should be 200 OK. This method either lacks a 200 OK response or defines a different 2xx status code.' ,
8586 path : [ 'paths' , '/resourceTwo/{id}' , 'put' ] ,
8687 severity : DiagnosticSeverity . Warning ,
8788 } ,
8889 {
89- code : 'xgen-IPA-107-put -method-response-code-is-200' ,
90+ code : 'xgen-IPA-107-update -method-response-code-is-200' ,
9091 message :
9192 'The Update method response status code should be 200 OK. This method either lacks a 200 OK response or defines a different 2xx status code.' ,
9293 path : [ 'paths' , '/resourceThree/{id}' , 'put' ] ,
9394 severity : DiagnosticSeverity . Warning ,
9495 } ,
9596 {
96- code : 'xgen-IPA-107-put -method-response-code-is-200' ,
97+ code : 'xgen-IPA-107-update -method-response-code-is-200' ,
9798 message :
9899 'The Update method response status code should be 200 OK. This method either lacks a 200 OK response or defines a different 2xx status code.' ,
99100 path : [ 'paths' , '/resource/{id}/singleton' , 'put' ] ,
@@ -113,7 +114,7 @@ testRule('xgen-IPA-107-put-method-response-code-is-200', [
113114 500 : { } ,
114115 } ,
115116 'x-xgen-IPA-exception' : {
116- 'xgen-IPA-107-put -method-response-code-is-200' : 'reason' ,
117+ 'xgen-IPA-107-update -method-response-code-is-200' : 'reason' ,
117118 } ,
118119 } ,
119120 } ,
@@ -124,7 +125,7 @@ testRule('xgen-IPA-107-put-method-response-code-is-200', [
124125 500 : { } ,
125126 } ,
126127 'x-xgen-IPA-exception' : {
127- 'xgen-IPA-107-put -method-response-code-is-200' : 'reason' ,
128+ 'xgen-IPA-107-update -method-response-code-is-200' : 'reason' ,
128129 } ,
129130 } ,
130131 } ,
@@ -136,7 +137,7 @@ testRule('xgen-IPA-107-put-method-response-code-is-200', [
136137 500 : { } ,
137138 } ,
138139 'x-xgen-IPA-exception' : {
139- 'xgen-IPA-107-put -method-response-code-is-200' : 'reason' ,
140+ 'xgen-IPA-107-update -method-response-code-is-200' : 'reason' ,
140141 } ,
141142 } ,
142143 } ,
@@ -146,7 +147,8 @@ testRule('xgen-IPA-107-put-method-response-code-is-200', [
146147 } ,
147148] ) ;
148149
149- testRule ( 'xgen-IPA-107-patch-method-response-code-is-200' , [
150+ // Patch
151+ testRule ( 'xgen-IPA-107-update-method-response-code-is-200' , [
150152 {
151153 name : 'valid methods' ,
152154 document : {
@@ -217,28 +219,28 @@ testRule('xgen-IPA-107-patch-method-response-code-is-200', [
217219 } ,
218220 errors : [
219221 {
220- code : 'xgen-IPA-107-patch -method-response-code-is-200' ,
222+ code : 'xgen-IPA-107-update -method-response-code-is-200' ,
221223 message :
222224 'The Update method response status code should be 200 OK. This method either lacks a 200 OK response or defines a different 2xx status code.' ,
223225 path : [ 'paths' , '/resourceOne/{id}' , 'patch' ] ,
224226 severity : DiagnosticSeverity . Warning ,
225227 } ,
226228 {
227- code : 'xgen-IPA-107-patch -method-response-code-is-200' ,
229+ code : 'xgen-IPA-107-update -method-response-code-is-200' ,
228230 message :
229231 'The Update method response status code should be 200 OK. This method either lacks a 200 OK response or defines a different 2xx status code.' ,
230232 path : [ 'paths' , '/resourceTwo/{id}' , 'patch' ] ,
231233 severity : DiagnosticSeverity . Warning ,
232234 } ,
233235 {
234- code : 'xgen-IPA-107-patch -method-response-code-is-200' ,
236+ code : 'xgen-IPA-107-update -method-response-code-is-200' ,
235237 message :
236238 'The Update method response status code should be 200 OK. This method either lacks a 200 OK response or defines a different 2xx status code.' ,
237239 path : [ 'paths' , '/resourceThree/{id}' , 'patch' ] ,
238240 severity : DiagnosticSeverity . Warning ,
239241 } ,
240242 {
241- code : 'xgen-IPA-107-patch -method-response-code-is-200' ,
243+ code : 'xgen-IPA-107-update -method-response-code-is-200' ,
242244 message :
243245 'The Update method response status code should be 200 OK. This method either lacks a 200 OK response or defines a different 2xx status code.' ,
244246 path : [ 'paths' , '/resource/{id}/singleton' , 'patch' ] ,
@@ -258,7 +260,7 @@ testRule('xgen-IPA-107-patch-method-response-code-is-200', [
258260 500 : { } ,
259261 } ,
260262 'x-xgen-IPA-exception' : {
261- 'xgen-IPA-107-patch -method-response-code-is-200' : 'reason' ,
263+ 'xgen-IPA-107-update -method-response-code-is-200' : 'reason' ,
262264 } ,
263265 } ,
264266 } ,
@@ -269,7 +271,7 @@ testRule('xgen-IPA-107-patch-method-response-code-is-200', [
269271 500 : { } ,
270272 } ,
271273 'x-xgen-IPA-exception' : {
272- 'xgen-IPA-107-patch -method-response-code-is-200' : 'reason' ,
274+ 'xgen-IPA-107-update -method-response-code-is-200' : 'reason' ,
273275 } ,
274276 } ,
275277 } ,
@@ -281,7 +283,7 @@ testRule('xgen-IPA-107-patch-method-response-code-is-200', [
281283 500 : { } ,
282284 } ,
283285 'x-xgen-IPA-exception' : {
284- 'xgen-IPA-107-patch -method-response-code-is-200' : 'reason' ,
286+ 'xgen-IPA-107-update -method-response-code-is-200' : 'reason' ,
285287 } ,
286288 } ,
287289 } ,
0 commit comments