@@ -545,9 +545,9 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
545
545
reqScope .MetaGroupVersion = * a .group .MetaGroupVersion
546
546
}
547
547
for _ , action := range actions {
548
- versionedObject := storageMeta .ProducesObject (action .Verb )
549
- if versionedObject == nil {
550
- versionedObject = defaultVersionedObject
548
+ producedObject := storageMeta .ProducesObject (action .Verb )
549
+ if producedObject == nil {
550
+ producedObject = defaultVersionedObject
551
551
}
552
552
reqScope .Namer = action .Namer
553
553
@@ -617,8 +617,8 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
617
617
Param (ws .QueryParameter ("pretty" , "If 'true', then the output is pretty printed." )).
618
618
Operation ("read" + namespaced + kind + strings .Title (subresource )+ operationSuffix ).
619
619
Produces (append (storageMeta .ProducesMIMETypes (action .Verb ), mediaTypes ... )... ).
620
- Returns (http .StatusOK , "OK" , versionedObject ).
621
- Writes (versionedObject )
620
+ Returns (http .StatusOK , "OK" , producedObject ).
621
+ Writes (producedObject )
622
622
if isGetterWithOptions {
623
623
if err := addObjectParams (ws , route , versionedGetOptions ); err != nil {
624
624
return nil , err
@@ -677,9 +677,9 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
677
677
Param (ws .QueryParameter ("pretty" , "If 'true', then the output is pretty printed." )).
678
678
Operation ("replace" + namespaced + kind + strings .Title (subresource )+ operationSuffix ).
679
679
Produces (append (storageMeta .ProducesMIMETypes (action .Verb ), mediaTypes ... )... ).
680
- Returns (http .StatusOK , "OK" , versionedObject ).
681
- Reads (versionedObject ).
682
- Writes (versionedObject )
680
+ Returns (http .StatusOK , "OK" , producedObject ).
681
+ Reads (defaultVersionedObject ).
682
+ Writes (producedObject )
683
683
addParams (route , action .Params )
684
684
routes = append (routes , route )
685
685
case "PATCH" : // Partially update a resource
@@ -694,9 +694,9 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
694
694
Consumes (string (types .JSONPatchType ), string (types .MergePatchType ), string (types .StrategicMergePatchType )).
695
695
Operation ("patch" + namespaced + kind + strings .Title (subresource )+ operationSuffix ).
696
696
Produces (append (storageMeta .ProducesMIMETypes (action .Verb ), mediaTypes ... )... ).
697
- Returns (http .StatusOK , "OK" , versionedObject ).
697
+ Returns (http .StatusOK , "OK" , producedObject ).
698
698
Reads (metav1.Patch {}).
699
- Writes (versionedObject )
699
+ Writes (producedObject )
700
700
addParams (route , action .Params )
701
701
routes = append (routes , route )
702
702
case "POST" : // Create a resource.
@@ -717,9 +717,9 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
717
717
Param (ws .QueryParameter ("pretty" , "If 'true', then the output is pretty printed." )).
718
718
Operation ("create" + namespaced + kind + strings .Title (subresource )+ operationSuffix ).
719
719
Produces (append (storageMeta .ProducesMIMETypes (action .Verb ), mediaTypes ... )... ).
720
- Returns (http .StatusOK , "OK" , versionedObject ).
721
- Reads (versionedObject ).
722
- Writes (versionedObject )
720
+ Returns (http .StatusOK , "OK" , producedObject ).
721
+ Reads (defaultVersionedObject ).
722
+ Writes (producedObject )
723
723
addParams (route , action .Params )
724
724
routes = append (routes , route )
725
725
case "DELETE" : // Delete a resource.
@@ -814,6 +814,10 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
814
814
routes = append (routes , buildProxyRoute (ws , "OPTIONS" , a .prefix , action .Path , kind , resource , subresource , namespaced , requestScope , hasSubresource , action .Params , proxyHandler , operationSuffix ))
815
815
case "CONNECT" :
816
816
for _ , method := range connecter .ConnectMethods () {
817
+ connectProducedObject := storageMeta .ProducesObject (method )
818
+ if connectProducedObject == nil {
819
+ connectProducedObject = "string"
820
+ }
817
821
doc := "connect " + method + " requests to " + kind
818
822
if hasSubresource {
819
823
doc = "connect " + method + " requests to " + subresource + " of " + kind
@@ -825,7 +829,7 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
825
829
Operation ("connect" + strings .Title (strings .ToLower (method )) + namespaced + kind + strings .Title (subresource ) + operationSuffix ).
826
830
Produces ("*/*" ).
827
831
Consumes ("*/*" ).
828
- Writes ("string" )
832
+ Writes (connectProducedObject )
829
833
if versionedConnectOptions != nil {
830
834
if err := addObjectParams (ws , route , versionedConnectOptions ); err != nil {
831
835
return nil , err
0 commit comments