Skip to content

Commit 08ec7d1

Browse files
feat(ipa): Upgrade warning-level rules to the error level
1 parent c2968f0 commit 08ec7d1

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ rules:
237237
- `ignoreList`: Words that are allowed to maintain their specific casing (e.g., "API", "AWS", "DNS")
238238
- `grammaticalWords`: Common words that can remain lowercase in titles (e.g., "and", "or", "the")
239239
message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-117-operation-summary-format'
240-
severity: warn
240+
severity: error
241241
given:
242242
- '#OperationObject.summary'
243243
then:
@@ -295,7 +295,7 @@ rules:
295295
This rule includes a configuration option:
296296
- `allowedStartVerbs`: Allow list of verb that the operation summary can start with, defaults to `['Return']`
297297
message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-117-get-operation-summary-starts-with'
298-
severity: warn
298+
severity: error
299299
given:
300300
- '$.paths[*][get].summary'
301301
then:
@@ -314,7 +314,7 @@ rules:
314314
This rule includes a configuration option:
315315
- `allowedStartVerbs`: Allow list of verb that the operation summary can start with, defaults to `['Update']`
316316
message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-117-update-operation-summary-starts-with'
317-
severity: warn
317+
severity: error
318318
given:
319319
- '$.paths[*][put,patch].summary'
320320
then:
@@ -333,7 +333,7 @@ rules:
333333
This rule includes a configuration option:
334334
- `allowedStartVerbs`: Allow list of verb that the operation summary can start with, defaults to `['Create', 'Add']`
335335
message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-117-create-operation-summary-starts-with'
336-
severity: warn
336+
severity: error
337337
given:
338338
- '$.paths[*][post].summary'
339339
then:
@@ -353,7 +353,7 @@ rules:
353353
This rule includes a configuration option:
354354
- `allowedStartVerbs`: Allow list of verb that the operation summary can start with, defaults to `['Delete', 'Remove']`
355355
message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-117-delete-operation-summary-starts-with'
356-
severity: warn
356+
severity: error
357357
given:
358358
- '$.paths[*][delete].summary'
359359
then:
@@ -374,7 +374,7 @@ rules:
374374
- `preferredWords`: List of words that the operation summary should use for single items, defaults to `['one']`. Only used for error messages
375375
- `forbiddenWords`: List of words (lowercase) that the operation summary should not use, defaults to `['a', 'specified']`
376376
message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-117-operation-summary-single-item-wording'
377-
severity: warn
377+
severity: error
378378
given:
379379
- '#OperationObject.summary'
380380
then:

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ rules:
7676
- Ensures that if a property is defined in multiple `oneOf` schemas, it must have the same type in each schema (base type or object schema)
7777
7878
message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-125-oneOf-schema-property-same-type'
79-
severity: warn
79+
severity: error
8080
given: '$.components.schemas..oneOf'
8181
then:
8282
function: 'IPA125OneOfSchemaPropertySameType'
@@ -88,7 +88,7 @@ rules:
8888
##### Implementation details
8989
- Rule checks that a `discriminator` property has a `oneOf`, `anyOf` or `allOf` sibling
9090
message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-125-discriminator-must-accompany-oneOf-anyOf-allOf'
91-
severity: warn
91+
severity: error
9292
given: '$..discriminator'
9393
then:
9494
function: 'IPA125DiscriminatorMustAccompanyOneOfAnyOfAllOf'

tools/spectral/ipa/rulesets/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ The rule checks for the presence of the `schema`, `examples` or `example` proper
883883

884884
#### xgen-IPA-117-operation-summary-format
885885

886-
![warn](https://img.shields.io/badge/warning-yellow)
886+
![error](https://img.shields.io/badge/error-red)
887887
Operation summaries must use Title Case, must not end with a period and must not use CommonMark.
888888

889889
##### Implementation details
@@ -896,7 +896,7 @@ This rule includes two configuration options:
896896

897897
#### xgen-IPA-117-get-operation-summary-starts-with
898898

899-
![warn](https://img.shields.io/badge/warning-yellow)
899+
![error](https://img.shields.io/badge/error-red)
900900
In operation summaries, use 'Return' instead of 'Get' or 'List'. For example "Return One Identity Provider".
901901

902902
##### Implementation details
@@ -908,7 +908,7 @@ This rule includes a configuration option:
908908

909909
#### xgen-IPA-117-update-operation-summary-starts-with
910910

911-
![warn](https://img.shields.io/badge/warning-yellow)
911+
![error](https://img.shields.io/badge/error-red)
912912
In operation summaries, use 'Update' instead of 'Modify' or 'Change'. For example "Update One Identity Provider".
913913

914914
##### Implementation details
@@ -920,7 +920,7 @@ This rule includes a configuration option:
920920

921921
#### xgen-IPA-117-create-operation-summary-starts-with
922922

923-
![warn](https://img.shields.io/badge/warning-yellow)
923+
![error](https://img.shields.io/badge/error-red)
924924
In operation summaries, use 'Create' when the operation is creating a resource, and use 'Add' when the resource itself isn't being created. For example "Create One Identity Provider" or "Add One MongoDB Cloud User to One Project".
925925

926926
##### Implementation details
@@ -932,7 +932,7 @@ This rule includes a configuration option:
932932

933933
#### xgen-IPA-117-delete-operation-summary-starts-with
934934

935-
![warn](https://img.shields.io/badge/warning-yellow)
935+
![error](https://img.shields.io/badge/error-red)
936936
In operation summaries, use 'Delete' when the operation is destroying a resource, and use 'Remove' when the resource itself isn't being destroyed. For example "Delete One Identity Provider" or "Remove One MongoDB Cloud User from One Project".
937937

938938
##### Implementation details
@@ -944,7 +944,7 @@ This rule includes a configuration option:
944944

945945
#### xgen-IPA-117-operation-summary-single-item-wording
946946

947-
![warn](https://img.shields.io/badge/warning-yellow)
947+
![error](https://img.shields.io/badge/error-red)
948948
API Producers must use "One" when referring to a single item instead of "a" or "specified".
949949

950950
##### Implementation details
@@ -1103,7 +1103,7 @@ object types with clear discriminators.
11031103

11041104
#### xgen-IPA-125-oneOf-schema-property-same-type
11051105

1106-
![warn](https://img.shields.io/badge/warning-yellow)
1106+
![error](https://img.shields.io/badge/error-red)
11071107
If multiple `oneOf` models define a property with the same name, that property **must** have the same base type or schema in each model
11081108

11091109
##### Implementation details
@@ -1113,7 +1113,7 @@ Rule checks for the following conditions:
11131113

11141114
#### xgen-IPA-125-discriminator-must-accompany-oneOf-anyOf-allOf
11151115

1116-
![warn](https://img.shields.io/badge/warning-yellow)
1116+
![error](https://img.shields.io/badge/error-red)
11171117
Each discriminator property must be accompanied by a `oneOf`, `anyOf` or `allOf` property
11181118

11191119
##### Implementation details

0 commit comments

Comments
 (0)