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
4b0fbfe1
Commit
4b0fbfe1
authored
May 15, 2017
by
mbohlool
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix: form parameters should have type in OpenAPI spec
parent
161b4801
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
openapi.go
staging/src/k8s.io/apiserver/pkg/server/openapi/openapi.go
+1
-1
openapi_test.go
...g/src/k8s.io/apiserver/pkg/server/openapi/openapi_test.go
+3
-1
No files found.
staging/src/k8s.io/apiserver/pkg/server/openapi/openapi.go
View file @
4b0fbfe1
...
@@ -495,7 +495,7 @@ func (o *openAPI) buildParameter(restParam restful.ParameterData, bodySample int
...
@@ -495,7 +495,7 @@ func (o *openAPI) buildParameter(restParam restful.ParameterData, bodySample int
case
restful
.
HeaderParameterKind
:
case
restful
.
HeaderParameterKind
:
ret
.
In
=
"header"
ret
.
In
=
"header"
case
restful
.
FormParameterKind
:
case
restful
.
FormParameterKind
:
ret
.
In
=
"form"
ret
.
In
=
"form
Data
"
default
:
default
:
return
ret
,
fmt
.
Errorf
(
"unknown restful operation kind : %v"
,
restParam
.
Kind
)
return
ret
,
fmt
.
Errorf
(
"unknown restful operation kind : %v"
,
restParam
.
Kind
)
}
}
...
...
staging/src/k8s.io/apiserver/pkg/server/openapi/openapi_test.go
View file @
4b0fbfe1
...
@@ -187,6 +187,7 @@ func getConfig(fullMethods bool) (*openapi.Config, *restful.Container) {
...
@@ -187,6 +187,7 @@ func getConfig(fullMethods bool) (*openapi.Config, *restful.Container) {
InfoProps
:
spec
.
InfoProps
{
InfoProps
:
spec
.
InfoProps
{
Title
:
"TestAPI"
,
Title
:
"TestAPI"
,
Description
:
"Test API"
,
Description
:
"Test API"
,
Version
:
"unversioned"
,
},
},
},
},
GetDefinitions
:
func
(
_
openapi
.
ReferenceCallback
)
map
[
string
]
openapi
.
OpenAPIDefinition
{
GetDefinitions
:
func
(
_
openapi
.
ReferenceCallback
)
map
[
string
]
openapi
.
OpenAPIDefinition
{
...
@@ -330,7 +331,7 @@ func getAdditionalTestParameters() []spec.Parameter {
...
@@ -330,7 +331,7 @@ func getAdditionalTestParameters() []spec.Parameter {
ParamProps
:
spec
.
ParamProps
{
ParamProps
:
spec
.
ParamProps
{
Name
:
"fparam"
,
Name
:
"fparam"
,
Description
:
"a test form parameter"
,
Description
:
"a test form parameter"
,
In
:
"form"
,
In
:
"form
Data
"
,
},
},
SimpleSchema
:
spec
.
SimpleSchema
{
SimpleSchema
:
spec
.
SimpleSchema
{
Type
:
"number"
,
Type
:
"number"
,
...
@@ -432,6 +433,7 @@ func TestBuildSwaggerSpec(t *testing.T) {
...
@@ -432,6 +433,7 @@ func TestBuildSwaggerSpec(t *testing.T) {
InfoProps
:
spec
.
InfoProps
{
InfoProps
:
spec
.
InfoProps
{
Title
:
"TestAPI"
,
Title
:
"TestAPI"
,
Description
:
"Test API"
,
Description
:
"Test API"
,
Version
:
"unversioned"
,
},
},
},
},
Swagger
:
"2.0"
,
Swagger
:
"2.0"
,
...
...
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