ocket8888 commented on code in PR #7213:
URL: https://github.com/apache/trafficcontrol/pull/7213#discussion_r1043785590


##########
traffic_ops/v4-client/servercapability.go:
##########
@@ -27,26 +27,26 @@ import (
 const apiServerCapabilities = "/server_capabilities"
 
 // CreateServerCapability creates the given Server Capability.
-func (to *Session) CreateServerCapability(sc tc.ServerCapability, opts 
RequestOptions) (tc.ServerCapabilityDetailResponse, toclientlib.ReqInf, error) {
-       var scResp tc.ServerCapabilityDetailResponse
+func (to *Session) CreateServerCapability(sc tc.ServerCapabilityV41, opts 
RequestOptions) (tc.ServerCapabilityDetailResponseV41, toclientlib.ReqInf, 
error) {
+       var scResp tc.ServerCapabilityDetailResponseV41

Review Comment:
   So unfortunately, we can't do this. This is a breaking call signature 
change, because if I have
   ```go
   var resp tc.ServerCapabilityDetailResponse
   resp, _, _ = to.CreateServerCapability(tc.ServerCapability{Name: "anything"})
   ```
   My code no longer compiles for this API version. You have to add a separate 
client method with the updated struct, deprecate the old one - and be sure to 
mention that the call signature will change in v5 rather than the new method 
name be used, because what you have in the v5 client is just fine.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to