@@ -23,7 +23,7 @@ const componentSchemas = {
2323 } ,
2424} ;
2525
26- testRule ( 'xgen-IPA-104-GET-resource-not-paginated ' , [
26+ testRule ( 'xgen-IPA-104-get-method-returns-single-resource ' , [
2727 {
2828 name : 'valid resources' ,
2929 document : {
@@ -97,21 +97,6 @@ testRule('xgen-IPA-104-GET-resource-not-paginated', [
9797 name : 'invalid resources' ,
9898 document : {
9999 paths : {
100- '/arrayResource' : {
101- get : {
102- responses : {
103- 200 : {
104- content : {
105- 'application/vnd.atlas.2024-08-05+json' : {
106- schema : {
107- $ref : '#/components/schemas/PaginatedSchema' ,
108- } ,
109- } ,
110- } ,
111- } ,
112- } ,
113- } ,
114- } ,
115100 '/arrayResource/{id}' : {
116101 get : {
117102 responses : {
@@ -127,21 +112,6 @@ testRule('xgen-IPA-104-GET-resource-not-paginated', [
127112 } ,
128113 } ,
129114 } ,
130- '/paginatedResource' : {
131- get : {
132- responses : {
133- 200 : {
134- content : {
135- 'application/vnd.atlas.2024-08-05+json' : {
136- schema : {
137- $ref : '#/components/schemas/PaginatedSchema' ,
138- } ,
139- } ,
140- } ,
141- } ,
142- } ,
143- } ,
144- } ,
145115 '/paginatedResource/{id}' : {
146116 get : {
147117 responses : {
@@ -192,7 +162,7 @@ testRule('xgen-IPA-104-GET-resource-not-paginated', [
192162 } ,
193163 errors : [
194164 {
195- code : 'xgen-IPA-104-GET-resource-not-paginated ' ,
165+ code : 'xgen-IPA-104-get-method-returns-single-resource ' ,
196166 message :
197167 'Get methods should return data for a single resource. This method returns an array or a paginated response. http://go/ipa/104' ,
198168 path : [
@@ -207,7 +177,7 @@ testRule('xgen-IPA-104-GET-resource-not-paginated', [
207177 severity : DiagnosticSeverity . Warning ,
208178 } ,
209179 {
210- code : 'xgen-IPA-104-GET-resource-not-paginated ' ,
180+ code : 'xgen-IPA-104-get-method-returns-single-resource ' ,
211181 message :
212182 'Get methods should return data for a single resource. This method returns an array or a paginated response. http://go/ipa/104' ,
213183 path : [
@@ -222,7 +192,7 @@ testRule('xgen-IPA-104-GET-resource-not-paginated', [
222192 severity : DiagnosticSeverity . Warning ,
223193 } ,
224194 {
225- code : 'xgen-IPA-104-GET-resource-not-paginated ' ,
195+ code : 'xgen-IPA-104-get-method-returns-single-resource ' ,
226196 message :
227197 'Get methods should return data for a single resource. This method returns an array or a paginated response. http://go/ipa/104' ,
228198 path : [
@@ -237,7 +207,7 @@ testRule('xgen-IPA-104-GET-resource-not-paginated', [
237207 severity : DiagnosticSeverity . Warning ,
238208 } ,
239209 {
240- code : 'xgen-IPA-104-GET-resource-not-paginated ' ,
210+ code : 'xgen-IPA-104-get-method-returns-single-resource ' ,
241211 message :
242212 'Get methods should return data for a single resource. This method returns an array or a paginated response. http://go/ipa/104' ,
243213 path : [
@@ -254,35 +224,38 @@ testRule('xgen-IPA-104-GET-resource-not-paginated', [
254224 ] ,
255225 } ,
256226 {
257- name : 'invalid resource with exception ' ,
227+ name : 'invalid resources with exceptions ' ,
258228 document : {
259229 paths : {
260- '/arrayResource' : {
230+ '/arrayResource/{id} ' : {
261231 get : {
262232 responses : {
263233 200 : {
264234 content : {
265235 'application/vnd.atlas.2024-08-05+json' : {
236+ 'x-xgen-IPA-exception' : {
237+ 'xgen-IPA-104-get-method-returns-single-resource' : 'reason' ,
238+ } ,
266239 schema : {
267- $ref : '#/components/schemas/PaginatedSchema ' ,
240+ $ref : '#/components/schemas/ArraySchema ' ,
268241 } ,
269242 } ,
270243 } ,
271244 } ,
272245 } ,
273246 } ,
274247 } ,
275- '/arrayResource/{id} ' : {
248+ '/paginatedSingleton ' : {
276249 get : {
277250 responses : {
278251 200 : {
279252 content : {
280253 'application/vnd.atlas.2024-08-05+json' : {
281254 'x-xgen-IPA-exception' : {
282- 'xgen-IPA-104-GET-resource-not-paginated ' : 'reason' ,
255+ 'xgen-IPA-104-get-method-returns-single-resource ' : 'reason' ,
283256 } ,
284257 schema : {
285- $ref : '#/components/schemas/ArraySchema ' ,
258+ $ref : '#/components/schemas/PaginatedSchema ' ,
286259 } ,
287260 } ,
288261 } ,
0 commit comments