diff --git a/healthx/doc.go b/healthx/doc.go index fb2e9500..0bbd448d 100644 --- a/healthx/doc.go +++ b/healthx/doc.go @@ -6,12 +6,16 @@ package healthx import "strings" +// The health status of the service. +// // swagger:model healthStatus type swaggerHealthStatus struct { // Status always contains "ok". Status string `json:"status"` } +// The not ready status of the service. +// // swagger:model healthNotReadyStatus type swaggerNotReadyStatus struct { // Errors contains a list of errors that caused the not ready status. @@ -26,7 +30,9 @@ func (s swaggerNotReadyStatus) Error() string { return strings.Join(errs, "; ") } -// swagger:model version +// The service's version. +// +// swagger:model serviceVersion type swaggerVersion struct { // Version is the service's version. Version string `json:"version"` diff --git a/healthx/openapi/patch.yaml b/healthx/openapi/patch.yaml index 2d4baef3..ba20da51 100644 --- a/healthx/openapi/patch.yaml +++ b/healthx/openapi/patch.yaml @@ -17,13 +17,7 @@ content: application/json: schema: - required: - - status - type: object - properties: - status: - description: Always "ok". - type: string + "$ref": "#/components/schemas/healthStatus" description: '{{.ProjectHumanName}} is ready to accept connections.' default: content: @@ -52,27 +46,13 @@ content: application/json: schema: - required: - - status - type: object - properties: - status: - description: Always "ok". - type: string + "$ref": "#/components/schemas/healthStatus" description: '{{.ProjectHumanName}} is ready to accept requests.' '503': content: application/json: schema: - required: - - errors - properties: - errors: - additionalProperties: - type: string - description: Errors contains a list of errors that caused the not ready status. - type: object - type: object + "$ref": "#/components/schemas/healthNotReadyStatus" description: Ory Kratos is not yet ready to accept requests. default: content: @@ -100,13 +80,7 @@ content: application/json: schema: - type: object - required: - - version - properties: - version: - description: The version of {{.ProjectHumanName}}. - type: string + "$ref": "#/components/schemas/serviceVersion" description: Returns the {{.ProjectHumanName}} version. summary: Return Running Software Version. tags: {{ .HealthPathTags | toJson }}