Skip to content

Commit

Permalink
feat: support healthcheck rfc draft 06
Browse files Browse the repository at this point in the history
* Update MIME type of health checks to match latest draft

* Fix a typo: heath -> health
  • Loading branch information
harryjubb authored Jun 26, 2023
1 parent dea1776 commit de07125
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions __tests__/api-health-format.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const template = (contentType: string) => {
testRule("api-health-format", [
{
name: "valid case",
document: template("application/vnd.health+json"),
document: template("application/health+json"),
errors: [],
},

Expand All @@ -36,7 +36,7 @@ testRule("api-health-format", [
errors: [
{
message:
"Health path (`/heath`) SHOULD support Health Check Response Format",
"Health path (`/health`) SHOULD support Health Check Response Format",
path: [
"paths",
"/health",
Expand All @@ -57,7 +57,7 @@ testRule("api-health-format", [
errors: [
{
message:
"Health path (`/heath`) SHOULD support Health Check Response Format",
"Health path (`/health`) SHOULD support Health Check Response Format",
path: [
"paths",
"/health",
Expand Down
4 changes: 2 additions & 2 deletions src/ruleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ export default {
// Author: Phil Sturgeon (https://github.com/philsturgeon)
"api-health-format": {
message:
"Health path (`/heath`) SHOULD support Health Check Response Format",
"Health path (`/health`) SHOULD support Health Check Response Format",
description:
"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. To learn more about health check endpoints see https://apisyouwonthate.com/blog/health-checks-with-kubernetes.",
formats: [oas3],
given: "$.paths[/health]..responses[*].content.*~",
then: {
function: enumeration,
functionOptions: {
values: ["application/vnd.health+json"],
values: ["application/health+json"],
},
},
severity: DiagnosticSeverity.Warning,
Expand Down

0 comments on commit de07125

Please sign in to comment.