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 = `{
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/main.Health"
"$ref": "#/definitions/main.Health2"
}
},
"503": {
"description": "Service Unavailable",
"schema": {
"$ref": "#/definitions/main.Health"
"$ref": "#/definitions/main.Health2"
}
}
}
......@@ -1691,23 +1691,20 @@ const docTemplate = `{
}
}
},
"main.Health": {
"main.Health2": {
"type": "object",
"properties": {
"auth": {
"$ref": "#/definitions/main.HealthStatus"
"type": "string"
},
"importer": {
"$ref": "#/definitions/main.HealthStatus"
"type": "string"
},
"store": {
"$ref": "#/definitions/main.HealthStatus"
"type": "string"
}
}
},
"main.HealthStatus": {
"type": "object"
},
"store.File": {
"type": "object",
"properties": {
......
......@@ -114,12 +114,19 @@ type Health struct {
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.
// @Summary Check health
// @Description Checks daemon health.
// @Produce json
// @Success 200 {object} Health
// @Failure 503 {object} Health
// @Success 200 {object} HealthDoc
// @Failure 503 {object} HealthDoc
// @Router /healthz [get]
func healthzHandler(c *gin.Context, st *store.Store, im *importer.Importer) {
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