Skip to content

Commit

Permalink
fix: api-health had invalid severity
Browse files Browse the repository at this point in the history
  • Loading branch information
philsturgeon committed Jul 6, 2022
1 parent 18d0c41 commit 8bc5f34
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ruleset.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,19 @@ export default {
'api-health': {
description: 'APIs MUST have a health path (`/health`) defined.',
message: 'Creating a `/health` endpoint is a simple solution for pull-based monitoring and manually checking the status of an API.',
severity: 'warning',
given: "$.paths",
then: {
field: "/health",
function: truthy,
}
},
severity: 'warn',
},

// Author: Phil Sturgeon (https://github.com/philsturgeon)
'api-health-format': {
description: 'Health path (`/heath`) SHOULD support Health Check Response Format',
message: 'Use existing standards (and draft standards) wherever possible, like the draft standard for health checks: https://datatracker.ietf.org/doc/html/draft-inadarei-api-health-check',
formats: [oas3],
severity: 'warn',
given: "$.paths.[/health].responses[*].content.*~",
then: {
function: enumeration,
Expand All @@ -64,21 +63,22 @@ export default {
"application/vnd.health+json"
]
}
}
},
severity: 'warn',
},

// Author: Phil Sturgeon (https://github.com/philsturgeon)
'paths-kebab-case': {
description: 'Should paths be kebab-case.',
message: '{{property}} should be kebab-case (lower case and separated with hyphens)',
severity: 'warn',
given: "$.paths[*]~",
then: {
function: pattern,
functionOptions: {
match: '^(/|[a-z0-9-.]+|{[a-zA-Z0-9_]+})+$'
}
}
},
severity: 'warn',
},

// Author: Phil Sturgeon (https://github.com/philsturgeon)
Expand Down

0 comments on commit 8bc5f34

Please sign in to comment.