Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Made Snap work with go-swagger only
Browse files Browse the repository at this point in the history
  • Loading branch information
candysmurf committed May 17, 2017
1 parent 22cd662 commit 0d2f5ee
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions mgmt/rest/v2/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type PluginConfigResponse struct {
//swagger:parameters setPluginConfigItem
type PluginConfigParam struct {
// in: body
Config string `json:"config"`
Config map[string]interface{} `json:"config"`
}

// PluginConfigDeleteParams defines parameters for deleting a config.
Expand All @@ -69,7 +69,7 @@ type PluginConfigDeleteParams struct {
PType string `json:"ptype"`
// in: body
// required: true
Config string `json:"config"`
Config []string `json:"config"`
}

func (s *apiV2) getPluginConfigItem(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
Expand Down
2 changes: 1 addition & 1 deletion mgmt/rest/v2/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ type TaskPostParams struct {
// in: body
//
// required: true
Task string `json:"task"yaml:"task"`
Task Task `json:"task"yaml:"task"`
}

// TaskPutParams defines a task state
Expand Down
12 changes: 9 additions & 3 deletions swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,10 @@
"name": "config",
"in": "body",
"schema": {
"type": "string"
"type": "object",
"additionalProperties": {
"type": "object"
}
}
},
{
Expand Down Expand Up @@ -450,7 +453,10 @@
"in": "body",
"required": true,
"schema": {
"type": "string"
"type": "array",
"items": {
"type": "string"
}
}
}
],
Expand Down Expand Up @@ -510,7 +516,7 @@
"in": "body",
"required": true,
"schema": {
"type": "string"
"$ref": "#/definitions/Task"
}
}
],
Expand Down

0 comments on commit 0d2f5ee

Please sign in to comment.