Commit fed90a8c authored by robwa's avatar robwa
Browse files

fix: Use swaggertype for custom schema types

parent 92ac5b8a
......@@ -1525,13 +1525,13 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/main.Health2"
"$ref": "#/definitions/main.Health"
}
},
"503": {
"description": "Service Unavailable",
"schema": {
"$ref": "#/definitions/main.Health2"
"$ref": "#/definitions/main.Health"
}
}
}
......@@ -1691,7 +1691,7 @@ const docTemplate = `{
}
}
},
"main.Health2": {
"main.Health": {
"type": "object",
"properties": {
"auth": {
......
......@@ -109,24 +109,17 @@ func (s HealthStatus) MarshalText() (data []byte, err error) {
}
type Health struct {
Auth HealthStatus `json:"auth"`
Store HealthStatus `json:"store"`
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"`
Auth HealthStatus `json:"auth" swaggertype:"string"`
Store HealthStatus `json:"store" swaggertype:"string"`
Importer HealthStatus `json:"importer" swaggertype:"string"`
}
// healthzHandler checks daemon health.
// @Summary Check health
// @Description Checks daemon health.
// @Produce json
// @Success 200 {object} HealthDoc
// @Failure 503 {object} HealthDoc
// @Success 200 {object} Health
// @Failure 503 {object} Health
// @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