mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-23 04:51:39 +02:00
Fix API tag data type
This commit is contained in:
@@ -192,7 +192,7 @@ const docTemplate = `{
|
||||
"201": {
|
||||
"description": "Job resource",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/schema.Job"
|
||||
"$ref": "#/definitions/schema.JobMeta"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
@@ -303,17 +303,7 @@ const docTemplate = `{
|
||||
"description": "Array of tag-objects for request payload",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"description": "Tag Name",
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"description": "Tag Type",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
"$ref": "#/definitions/api.Tag"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -392,23 +382,17 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"api.TagJobApiRequest": {
|
||||
"description": "Request to tag a job.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"error": {
|
||||
"description": "Error Message",
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"description": "Statustext of Errorcode",
|
||||
"type": "string"
|
||||
}
|
||||
"api.Tag": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
"schema.Job": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@@ -112,13 +112,14 @@ type ErrorResponse struct {
|
||||
Error string `json:"error"` // Error Message
|
||||
}
|
||||
|
||||
type Tag struct {
|
||||
Type string `json:"type"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
// TagJobApiRequest model
|
||||
// @Description Array of tag-objects for request payload
|
||||
type TagJobApiRequest []*struct {
|
||||
// Tag Name
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"` // Tag Type
|
||||
}
|
||||
type TagJobApiRequest []*Tag
|
||||
|
||||
func handleError(err error, statusCode int, rw http.ResponseWriter) {
|
||||
log.Warnf("REST API: %s", err.Error())
|
||||
|
Reference in New Issue
Block a user