diff --git a/api/swagger-spec/v1.json b/api/swagger-spec/v1.json index 146bfb2eaf8..2cebdec3647 100644 --- a/api/swagger-spec/v1.json +++ b/api/swagger-spec/v1.json @@ -5909,7 +5909,7 @@ "allowMultiple": false }, { - "type": "", + "type": "string", "paramType": "query", "name": "command", "description": "Command is the remote command to execute. argv array. Not executed within a shell.", @@ -5987,7 +5987,7 @@ "allowMultiple": false }, { - "type": "", + "type": "string", "paramType": "query", "name": "command", "description": "Command is the remote command to execute. argv array. Not executed within a shell.", diff --git a/pkg/apiserver/api_installer.go b/pkg/apiserver/api_installer.go index f45c830f93f..4fb7251e922 100644 --- a/pkg/apiserver/api_installer.go +++ b/pkg/apiserver/api_installer.go @@ -807,7 +807,7 @@ func addObjectParams(ws *restful.WebService, route *restful.RouteBuilder, obj in if docable, ok := obj.(documentable); ok { desc = docable.SwaggerDoc()[jsonName] } - route.Param(ws.QueryParameter(jsonName, desc).DataType(typeToJSON(sf.Type.Name()))) + route.Param(ws.QueryParameter(jsonName, desc).DataType(typeToJSON(sf.Type.String()))) } } } @@ -822,12 +822,16 @@ func typeToJSON(typeName string) string { return "boolean" case "uint8", "int", "int32", "int64", "uint32", "uint64": return "integer" - case "byte": - return "string" case "float64", "float32": return "number" case "unversioned.Time": return "string" + case "byte": + return "string" + case "[]string": + // TODO: Fix this when go-restful supports a way to specify an array query param: + // https://github.com/emicklei/go-restful/issues/225 + return "string" default: return typeName }