Swagger output for PATCH can be more strongly typed

This commit is contained in:
Clayton Coleman 2015-06-17 15:21:54 -04:00
parent 1ba909098e
commit 93f921b677
2 changed files with 5 additions and 2 deletions

View File

@ -64,3 +64,6 @@ func (apiVersions APIVersions) String() string {
func (apiVersions APIVersions) GoString() string {
return apiVersions.String()
}
// Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.
type Patch struct{}

View File

@ -447,8 +447,8 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
Consumes(string(api.JSONPatchType), string(api.MergePatchType), string(api.StrategicMergePatchType)).
Operation("patch"+kind+strings.Title(subresource)).
Produces(append(storageMeta.ProducesMIMETypes(action.Verb), "application/json")...).
Returns(http.StatusOK, "OK", "string").
Reads("string").
Returns(http.StatusOK, "OK", versionedObject).
Reads(api.Patch{}).
Writes(versionedObject)
addParams(route, action.Params)
ws.Route(route)