Skip to content

Commit

Permalink
feat: Remove rule path-description-is-mandatory (#34)
Browse files Browse the repository at this point in the history
Disabled the rule path-description-is-mandatory in favour of the rule operation-description provided by spectral. The rule tag-description was also enabled as it is not in the recommendet ruleset.
  • Loading branch information
markbrockhoff committed Dec 15, 2022
1 parent d19b517 commit 11820fd
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 62 deletions.
36 changes: 0 additions & 36 deletions rules/endpoint/path-description-is-mandatory.spec.ts

This file was deleted.

13 changes: 0 additions & 13 deletions rules/endpoint/path-description-is-mandatory.yml

This file was deleted.

2 changes: 1 addition & 1 deletion spectral-api.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
extends:
- https://raw.githubusercontent.com/SchwarzIT/api-linter-rules/main/spectral.yml
rules:
tag-description: info # Rule enabled from spectral openapi ruleset
operation-tag-defined: off
path-must-match-api-standards: off # Rule is still under discussion and therefore disabled
servers-must-match-api-standards: off # Rule is still under discussion and therefore disabled
common-responses-unauthorized: hint
no-http-verbs-in-resources: warn
path-description-is-mandatory: warn
info-description: warn
contact-information: warn
must-have-path: warn
Expand Down
2 changes: 1 addition & 1 deletion spectral-bff.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
extends:
- https://raw.githubusercontent.com/SchwarzIT/api-linter-rules/main/spectral.yml
rules:
tag-description: info # Rule enabled from spectral openapi ruleset
operation-tag-defined: off
path-must-match-api-standards: off # Rule is still under discussion and therefore disabled
servers-must-match-api-standards: off # Rule is still under discussion and therefore disabled
common-responses-unauthorized: hint
no-http-verbs-in-resources: info
path-description-is-mandatory: info
info-description: info
contact-information: info
must-have-path: info
Expand Down
2 changes: 1 addition & 1 deletion spectral-legacy.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
extends:
- https://raw.githubusercontent.com/SchwarzIT/api-linter-rules/main/spectral.yml
rules:
tag-description: info # Rule enabled from spectral openapi ruleset
operation-tag-defined: off
path-must-match-api-standards: off # Rule is still under discussion and therefore disabled
servers-must-match-api-standards: off # Rule is still under discussion and therefore disabled
common-responses-unauthorized: hint
no-http-verbs-in-resources: info
path-description-is-mandatory: info
info-description: info
contact-information: info
must-have-path: info
Expand Down
10 changes: 0 additions & 10 deletions spectral.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,6 @@ rules:
function: pattern
functionOptions:
notMatch: \/(get|post|put|patch|delete)(\/|$)
path-description-is-mandatory:
description: Every route of an API should have a description
message: "{{description}}; property: {{property}} is missing"
severity: error
given: $.paths[?(!@property.match(/well-known/ig))]
then:
- field: description
function: truthy
formats:
- oas3
must-have-content-type:
description: Every response must specify its content type
message: "{{description}}; property {{property}} is missing or not a valid content-type"
Expand Down

0 comments on commit 11820fd

Please sign in to comment.