Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
cd37cd7c
Commit
cd37cd7c
authored
Sep 19, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12507 from nikhiljindal/swaggerValid
Auto commit by PR queue bot
parents
c2f76e4c
4ee799e1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
v1.json
api/swagger-spec/v1.json
+2
-2
api_installer.go
pkg/apiserver/api_installer.go
+7
-3
No files found.
api/swagger-spec/v1.json
View file @
cd37cd7c
...
@@ -5909,7 +5909,7 @@
...
@@ -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 @@
...
@@ -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."
,
...
...
pkg/apiserver/api_installer.go
View file @
cd37cd7c
...
@@ -807,7 +807,7 @@ func addObjectParams(ws *restful.WebService, route *restful.RouteBuilder, obj in
...
@@ -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 {
...
@@ -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
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment