Skip to content

Commit

Permalink
bugfix: form parameters should have type in OpenAPI spec
Browse files Browse the repository at this point in the history
  • Loading branch information
mbohlool committed May 19, 2017
1 parent 161b480 commit 4b0fbfe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion staging/src/k8s.io/apiserver/pkg/server/openapi/openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ func (o *openAPI) buildParameter(restParam restful.ParameterData, bodySample int
case restful.HeaderParameterKind:
ret.In = "header"
case restful.FormParameterKind:
ret.In = "form"
ret.In = "formData"
default:
return ret, fmt.Errorf("unknown restful operation kind : %v", restParam.Kind)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ func getConfig(fullMethods bool) (*openapi.Config, *restful.Container) {
InfoProps: spec.InfoProps{
Title: "TestAPI",
Description: "Test API",
Version: "unversioned",
},
},
GetDefinitions: func(_ openapi.ReferenceCallback) map[string]openapi.OpenAPIDefinition {
Expand Down Expand Up @@ -330,7 +331,7 @@ func getAdditionalTestParameters() []spec.Parameter {
ParamProps: spec.ParamProps{
Name: "fparam",
Description: "a test form parameter",
In: "form",
In: "formData",
},
SimpleSchema: spec.SimpleSchema{
Type: "number",
Expand Down Expand Up @@ -432,6 +433,7 @@ func TestBuildSwaggerSpec(t *testing.T) {
InfoProps: spec.InfoProps{
Title: "TestAPI",
Description: "Test API",
Version: "unversioned",
},
},
Swagger: "2.0",
Expand Down

0 comments on commit 4b0fbfe

Please sign in to comment.