mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 15:58:37 +00:00
Fixing swagger spec
This commit is contained in:
parent
e7d4426158
commit
4ee799e181
@ -5909,7 +5909,7 @@
|
|||||||
"allowMultiple": false
|
"allowMultiple": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "",
|
"type": "string",
|
||||||
"paramType": "query",
|
"paramType": "query",
|
||||||
"name": "command",
|
"name": "command",
|
||||||
"description": "Command is the remote command to execute. argv array. Not executed within a shell.",
|
"description": "Command is the remote command to execute. argv array. Not executed within a shell.",
|
||||||
@ -5987,7 +5987,7 @@
|
|||||||
"allowMultiple": false
|
"allowMultiple": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "",
|
"type": "string",
|
||||||
"paramType": "query",
|
"paramType": "query",
|
||||||
"name": "command",
|
"name": "command",
|
||||||
"description": "Command is the remote command to execute. argv array. Not executed within a shell.",
|
"description": "Command is the remote command to execute. argv array. Not executed within a shell.",
|
||||||
|
@ -807,7 +807,7 @@ func addObjectParams(ws *restful.WebService, route *restful.RouteBuilder, obj in
|
|||||||
if docable, ok := obj.(documentable); ok {
|
if docable, ok := obj.(documentable); ok {
|
||||||
desc = docable.SwaggerDoc()[jsonName]
|
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"
|
return "boolean"
|
||||||
case "uint8", "int", "int32", "int64", "uint32", "uint64":
|
case "uint8", "int", "int32", "int64", "uint32", "uint64":
|
||||||
return "integer"
|
return "integer"
|
||||||
case "byte":
|
|
||||||
return "string"
|
|
||||||
case "float64", "float32":
|
case "float64", "float32":
|
||||||
return "number"
|
return "number"
|
||||||
case "unversioned.Time":
|
case "unversioned.Time":
|
||||||
return "string"
|
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:
|
default:
|
||||||
return typeName
|
return typeName
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user