Commit 93ab314a authored by robwa's avatar robwa
Browse files

fix: Fix return type doc for health endpoint

parent 0cb79447
...@@ -1525,13 +1525,13 @@ const docTemplate = `{ ...@@ -1525,13 +1525,13 @@ const docTemplate = `{
"200": { "200": {
"description": "OK", "description": "OK",
"schema": { "schema": {
"$ref": "#/definitions/main.Health" "$ref": "#/definitions/main.Health2"
} }
}, },
"503": { "503": {
"description": "Service Unavailable", "description": "Service Unavailable",
"schema": { "schema": {
"$ref": "#/definitions/main.Health" "$ref": "#/definitions/main.Health2"
} }
} }
} }
...@@ -1691,23 +1691,20 @@ const docTemplate = `{ ...@@ -1691,23 +1691,20 @@ const docTemplate = `{
} }
} }
}, },
"main.Health": { "main.Health2": {
"type": "object", "type": "object",
"properties": { "properties": {
"auth": { "auth": {
"$ref": "#/definitions/main.HealthStatus" "type": "string"
}, },
"importer": { "importer": {
"$ref": "#/definitions/main.HealthStatus" "type": "string"
}, },
"store": { "store": {
"$ref": "#/definitions/main.HealthStatus" "type": "string"
} }
} }
}, },
"main.HealthStatus": {
"type": "object"
},
"store.File": { "store.File": {
"type": "object", "type": "object",
"properties": { "properties": {
......
...@@ -114,12 +114,19 @@ type Health struct { ...@@ -114,12 +114,19 @@ type Health struct {
Importer HealthStatus `json:"importer"` Importer HealthStatus `json:"importer"`
} }
// HealthDoc is used in doc and prevents errors when checking response schema conformance with schemathesis
type HealthDoc struct {
Auth string `json:"auth"`
Store string `json:"store"`
Importer string `json:"importer"`
}
// healthzHandler checks daemon health. // healthzHandler checks daemon health.
// @Summary Check health // @Summary Check health
// @Description Checks daemon health. // @Description Checks daemon health.
// @Produce json // @Produce json
// @Success 200 {object} Health // @Success 200 {object} HealthDoc
// @Failure 503 {object} Health // @Failure 503 {object} HealthDoc
// @Router /healthz [get] // @Router /healthz [get]
func healthzHandler(c *gin.Context, st *store.Store, im *importer.Importer) { func healthzHandler(c *gin.Context, st *store.Store, im *importer.Importer) {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) // TODO: hardcoded value ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) // TODO: hardcoded value
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment