Skip to content

Commit 00b5939

Browse files
CLOUDP-309109: Third rollout for IPA validations
1 parent c8d48ad commit 00b5939

23 files changed

+156
-156
lines changed

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ testRule('xgen-IPA-102-collection-identifier-camelCase', [
4747
message:
4848
"Collection identifiers must be in camelCase. Path segment 'Resources' in path '/Resources' is not in camelCase.",
4949
path: ['paths', '/Resources'],
50-
severity: DiagnosticSeverity.Warning,
50+
severity: DiagnosticSeverity.Error,
5151
},
5252
],
5353
},
@@ -64,7 +64,7 @@ testRule('xgen-IPA-102-collection-identifier-camelCase', [
6464
message:
6565
"Collection identifiers must be in camelCase. Path segment 'resource_groups' in path '/resource_groups' is not in camelCase.",
6666
path: ['paths', '/resource_groups'],
67-
severity: DiagnosticSeverity.Warning,
67+
severity: DiagnosticSeverity.Error,
6868
},
6969
],
7070
},
@@ -81,7 +81,7 @@ testRule('xgen-IPA-102-collection-identifier-camelCase', [
8181
message:
8282
"Collection identifiers must be in camelCase. Path segment 'resource-groups' in path '/resource-groups' is not in camelCase.",
8383
path: ['paths', '/resource-groups'],
84-
severity: DiagnosticSeverity.Warning,
84+
severity: DiagnosticSeverity.Error,
8585
},
8686
],
8787
},
@@ -98,7 +98,7 @@ testRule('xgen-IPA-102-collection-identifier-camelCase', [
9898
message:
9999
"Collection identifiers must be in camelCase. Path segment 'Resources' in path '/Resources:createResource' is not in camelCase.",
100100
path: ['paths', '/Resources:createResource'],
101-
severity: DiagnosticSeverity.Warning,
101+
severity: DiagnosticSeverity.Error,
102102
},
103103
],
104104
},
@@ -115,7 +115,7 @@ testRule('xgen-IPA-102-collection-identifier-camelCase', [
115115
message:
116116
"Collection identifiers must be in camelCase. Path segment 'resourcesAPI' in path '/resourcesAPI' is not in camelCase.",
117117
path: ['paths', '/resourcesAPI'],
118-
severity: DiagnosticSeverity.Warning,
118+
severity: DiagnosticSeverity.Error,
119119
},
120120
],
121121
},
@@ -147,21 +147,21 @@ testRule('xgen-IPA-102-collection-identifier-camelCase', [
147147
message:
148148
"Collection identifiers must be in camelCase. Path '/api//users' contains double slashes (//) which is not allowed.",
149149
path: ['paths', '/api//users'],
150-
severity: DiagnosticSeverity.Warning,
150+
severity: DiagnosticSeverity.Error,
151151
},
152152
{
153153
code: 'xgen-IPA-102-collection-identifier-camelCase',
154154
message:
155155
"Collection identifiers must be in camelCase. Path '/resources///{resourceId}' contains double slashes (//) which is not allowed.",
156156
path: ['paths', '/resources///{resourceId}'],
157-
severity: DiagnosticSeverity.Warning,
157+
severity: DiagnosticSeverity.Error,
158158
},
159159
{
160160
code: 'xgen-IPA-102-collection-identifier-camelCase',
161161
message:
162162
"Collection identifiers must be in camelCase. Path '//doubleSlashAtStart' contains double slashes (//) which is not allowed.",
163163
path: ['paths', '//doubleSlashAtStart'],
164-
severity: DiagnosticSeverity.Warning,
164+
severity: DiagnosticSeverity.Error,
165165
},
166166
],
167167
},
@@ -188,21 +188,21 @@ testRule('xgen-IPA-102-collection-identifier-camelCase', [
188188
message:
189189
"Collection identifiers must be in camelCase. Path segment 'API' in path '/API/Resource_groups/{userId}/User-profiles' is not in camelCase.",
190190
path: ['paths', '/API/Resource_groups/{userId}/User-profiles'],
191-
severity: DiagnosticSeverity.Warning,
191+
severity: DiagnosticSeverity.Error,
192192
},
193193
{
194194
code: 'xgen-IPA-102-collection-identifier-camelCase',
195195
message:
196196
"Collection identifiers must be in camelCase. Path segment 'Resource_groups' in path '/API/Resource_groups/{userId}/User-profiles' is not in camelCase.",
197197
path: ['paths', '/API/Resource_groups/{userId}/User-profiles'],
198-
severity: DiagnosticSeverity.Warning,
198+
severity: DiagnosticSeverity.Error,
199199
},
200200
{
201201
code: 'xgen-IPA-102-collection-identifier-camelCase',
202202
message:
203203
"Collection identifiers must be in camelCase. Path segment 'User-profiles' in path '/API/Resource_groups/{userId}/User-profiles' is not in camelCase.",
204204
path: ['paths', '/API/Resource_groups/{userId}/User-profiles'],
205-
severity: DiagnosticSeverity.Warning,
205+
severity: DiagnosticSeverity.Error,
206206
},
207207
],
208208
},
@@ -219,14 +219,14 @@ testRule('xgen-IPA-102-collection-identifier-camelCase', [
219219
message:
220220
"Collection identifiers must be in camelCase. Path segment 'Valid' in path '/api/Valid/Invalid_resource/{id}:validCustomMethod' is not in camelCase.",
221221
path: ['paths', '/api/Valid/Invalid_resource/{id}:validCustomMethod'],
222-
severity: DiagnosticSeverity.Warning,
222+
severity: DiagnosticSeverity.Error,
223223
},
224224
{
225225
code: 'xgen-IPA-102-collection-identifier-camelCase',
226226
message:
227227
"Collection identifiers must be in camelCase. Path segment 'Invalid_resource' in path '/api/Valid/Invalid_resource/{id}:validCustomMethod' is not in camelCase.",
228228
path: ['paths', '/api/Valid/Invalid_resource/{id}:validCustomMethod'],
229-
severity: DiagnosticSeverity.Warning,
229+
severity: DiagnosticSeverity.Error,
230230
},
231231
],
232232
},
@@ -243,14 +243,14 @@ testRule('xgen-IPA-102-collection-identifier-camelCase', [
243243
message:
244244
"Collection identifiers must be in camelCase. Path '/api//Invalid_segment//resources' contains double slashes (//) which is not allowed.",
245245
path: ['paths', '/api//Invalid_segment//resources'],
246-
severity: DiagnosticSeverity.Warning,
246+
severity: DiagnosticSeverity.Error,
247247
},
248248
{
249249
code: 'xgen-IPA-102-collection-identifier-camelCase',
250250
message:
251251
"Collection identifiers must be in camelCase. Path segment 'Invalid_segment' in path '/api//Invalid_segment//resources' is not in camelCase.",
252252
path: ['paths', '/api//Invalid_segment//resources'],
253-
severity: DiagnosticSeverity.Warning,
253+
severity: DiagnosticSeverity.Error,
254254
},
255255
],
256256
},

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ testRule('xgen-IPA-102-collection-identifier-pattern', [
4747
message:
4848
"Collection identifiers must begin with a lowercase letter and contain only ASCII letters and numbers (/[a-z][a-zA-Z0-9]*/). Path segment 'Resources' in path '/Resources' doesn't match the required pattern.",
4949
path: ['paths', '/Resources'],
50-
severity: DiagnosticSeverity.Warning,
50+
severity: DiagnosticSeverity.Error,
5151
},
5252
],
5353
},
@@ -65,14 +65,14 @@ testRule('xgen-IPA-102-collection-identifier-pattern', [
6565
message:
6666
"Collection identifiers must begin with a lowercase letter and contain only ASCII letters and numbers (/[a-z][a-zA-Z0-9]*/). Path segment 'resource-groups' in path '/resource-groups' doesn't match the required pattern.",
6767
path: ['paths', '/resource-groups'],
68-
severity: DiagnosticSeverity.Warning,
68+
severity: DiagnosticSeverity.Error,
6969
},
7070
{
7171
code: 'xgen-IPA-102-collection-identifier-pattern',
7272
message:
7373
"Collection identifiers must begin with a lowercase letter and contain only ASCII letters and numbers (/[a-z][a-zA-Z0-9]*/). Path segment 'user_profiles' in path '/user_profiles' doesn't match the required pattern.",
7474
path: ['paths', '/user_profiles'],
75-
severity: DiagnosticSeverity.Warning,
75+
severity: DiagnosticSeverity.Error,
7676
},
7777
],
7878
},

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -394,50 +394,50 @@ testRule('xgen-IPA-106-create-method-request-body-is-get-method-response', [
394394
code: 'xgen-IPA-106-create-method-request-body-is-get-method-response',
395395
message: 'The request body schema properties must match the response body schema properties of the Get method.',
396396
path: ['paths', '/resource', 'post', 'requestBody', 'content', 'application/vnd.atlas.2023-01-01+json'],
397-
severity: DiagnosticSeverity.Warning,
397+
severity: DiagnosticSeverity.Error,
398398
},
399399
{
400400
code: 'xgen-IPA-106-create-method-request-body-is-get-method-response',
401401
message: 'The request body schema properties must match the response body schema properties of the Get method.',
402402
path: ['paths', '/resource', 'post', 'requestBody', 'content', 'application/vnd.atlas.2024-01-01+json'],
403-
severity: DiagnosticSeverity.Warning,
403+
severity: DiagnosticSeverity.Error,
404404
},
405405
{
406406
code: 'xgen-IPA-106-create-method-request-body-is-get-method-response',
407407
message: 'The request body schema properties must match the response body schema properties of the Get method.',
408408
path: ['paths', '/resourceTwo', 'post', 'requestBody', 'content', 'application/vnd.atlas.2023-01-01+json'],
409-
severity: DiagnosticSeverity.Warning,
409+
severity: DiagnosticSeverity.Error,
410410
},
411411
{
412412
code: 'xgen-IPA-106-create-method-request-body-is-get-method-response',
413413
message: 'The request body schema properties must match the response body schema properties of the Get method.',
414414
path: ['paths', '/resourceTwo', 'post', 'requestBody', 'content', 'application/vnd.atlas.2024-01-01+json'],
415-
severity: DiagnosticSeverity.Warning,
415+
severity: DiagnosticSeverity.Error,
416416
},
417417
{
418418
code: 'xgen-IPA-106-create-method-request-body-is-get-method-response',
419419
message: 'The request body schema properties must match the response body schema properties of the Get method.',
420420
path: ['paths', '/resourceThree', 'post', 'requestBody', 'content', 'application/vnd.atlas.2023-01-01+json'],
421-
severity: DiagnosticSeverity.Warning,
421+
severity: DiagnosticSeverity.Error,
422422
},
423423
{
424424
code: 'xgen-IPA-106-create-method-request-body-is-get-method-response',
425425
message:
426426
'Could not validate that the Create request body schema matches the response schema of the Get method. The Get method does not have a schema.',
427427
path: ['paths', '/resourceFour', 'post', 'requestBody', 'content', 'application/vnd.atlas.2023-01-01+json'],
428-
severity: DiagnosticSeverity.Warning,
428+
severity: DiagnosticSeverity.Error,
429429
},
430430
{
431431
code: 'xgen-IPA-106-create-method-request-body-is-get-method-response',
432432
message: 'The request body schema properties must match the response body schema properties of the Get method.',
433433
path: ['paths', '/resourceCircular', 'post', 'requestBody', 'content', 'application/vnd.atlas.2023-01-01+json'],
434-
severity: DiagnosticSeverity.Warning,
434+
severity: DiagnosticSeverity.Error,
435435
},
436436
{
437437
code: 'xgen-IPA-106-create-method-request-body-is-get-method-response',
438438
message: 'The request body schema properties must match the response body schema properties of the Get method.',
439439
path: ['paths', '/resourceCircular', 'post', 'requestBody', 'content', 'application/vnd.atlas.2024-01-01+json'],
440-
severity: DiagnosticSeverity.Warning,
440+
severity: DiagnosticSeverity.Error,
441441
},
442442
],
443443
},
@@ -486,13 +486,13 @@ testRule('xgen-IPA-106-create-method-request-body-is-get-method-response', [
486486
code: 'xgen-IPA-106-create-method-request-body-is-get-method-response',
487487
message: 'The request body schema properties must match the response body schema properties of the Get method.',
488488
path: ['paths', '/animalResource', 'post', 'requestBody', 'content', 'application/vnd.atlas.2023-01-01+json'],
489-
severity: DiagnosticSeverity.Warning,
489+
severity: DiagnosticSeverity.Error,
490490
},
491491
{
492492
code: 'xgen-IPA-106-create-method-request-body-is-get-method-response',
493493
message: 'The request body schema properties must match the response body schema properties of the Get method.',
494494
path: ['paths', '/animalResource', 'post', 'requestBody', 'content', 'application/vnd.atlas.2024-01-01+json'],
495-
severity: DiagnosticSeverity.Warning,
495+
severity: DiagnosticSeverity.Error,
496496
},
497497
],
498498
},

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ testRule('xgen-IPA-106-create-method-response-is-get-method-response', [
241241
'content',
242242
'application/vnd.atlas.2024-01-05+json',
243243
],
244-
severity: DiagnosticSeverity.Warning,
244+
severity: DiagnosticSeverity.Error,
245245
},
246246
{
247247
code: 'xgen-IPA-106-create-method-response-is-get-method-response',
@@ -256,7 +256,7 @@ testRule('xgen-IPA-106-create-method-response-is-get-method-response', [
256256
'content',
257257
'application/vnd.atlas.2024-01-05+json',
258258
],
259-
severity: DiagnosticSeverity.Warning,
259+
severity: DiagnosticSeverity.Error,
260260
},
261261
],
262262
},
@@ -302,7 +302,7 @@ testRule('xgen-IPA-106-create-method-response-is-get-method-response', [
302302
code: 'xgen-IPA-106-create-method-response-is-get-method-response',
303303
message: 'The schema in the Create method response must be the same schema as the response of the Get method.',
304304
path: ['paths', '/resources', 'post', 'responses', '201', 'content', 'application/vnd.atlas.2024-08-05+json'],
305-
severity: DiagnosticSeverity.Warning,
305+
severity: DiagnosticSeverity.Error,
306306
},
307307
],
308308
},

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,19 +123,19 @@ testRule('xgen-IPA-107-update-must-not-have-query-params', [
123123
code: 'xgen-IPA-107-update-must-not-have-query-params',
124124
message: 'Update operations must not have query parameters. Found [filter].',
125125
path: ['paths', '/resource/{id}', 'put'],
126-
severity: DiagnosticSeverity.Warning,
126+
severity: DiagnosticSeverity.Error,
127127
},
128128
{
129129
code: 'xgen-IPA-107-update-must-not-have-query-params',
130130
message: 'Update operations must not have query parameters. Found [query-param].',
131131
path: ['paths', '/resource/{id}/singleton', 'put'],
132-
severity: DiagnosticSeverity.Warning,
132+
severity: DiagnosticSeverity.Error,
133133
},
134134
{
135135
code: 'xgen-IPA-107-update-must-not-have-query-params',
136136
message: 'Update operations must not have query parameters. Found [query-param-2].',
137137
path: ['paths', '/resource/{id}/singleton', 'put'],
138-
severity: DiagnosticSeverity.Warning,
138+
severity: DiagnosticSeverity.Error,
139139
},
140140
],
141141
},
@@ -259,19 +259,19 @@ testRule('xgen-IPA-107-update-must-not-have-query-params', [
259259
code: 'xgen-IPA-107-update-must-not-have-query-params',
260260
message: 'Update operations must not have query parameters. Found [filter].',
261261
path: ['paths', '/resource/{id}', 'patch'],
262-
severity: DiagnosticSeverity.Warning,
262+
severity: DiagnosticSeverity.Error,
263263
},
264264
{
265265
code: 'xgen-IPA-107-update-must-not-have-query-params',
266266
message: 'Update operations must not have query parameters. Found [query-param].',
267267
path: ['paths', '/resource/{id}/singleton', 'patch'],
268-
severity: DiagnosticSeverity.Warning,
268+
severity: DiagnosticSeverity.Error,
269269
},
270270
{
271271
code: 'xgen-IPA-107-update-must-not-have-query-params',
272272
message: 'Update operations must not have query parameters. Found [query-param-2].',
273273
path: ['paths', '/resource/{id}/singleton', 'patch'],
274-
severity: DiagnosticSeverity.Warning,
274+
severity: DiagnosticSeverity.Error,
275275
},
276276
],
277277
},

0 commit comments

Comments
 (0)