Closed zsiec closed 5 years ago
I was able to unblock myself by forking and using this workaround:
ack -l "(api.apiClient.Post\(\".*\",\s)(\&[a-zA-Z0-9_-]*,\s*\sreqParams)" | xargs perl -pi -E 's/(api.apiClient.Post\(\".*\",\s)(\&[a-zA-Z0-9_-]*,\s*\sreqParams)/$1struct{}{}, $2/g'
This is only a workaround and may not be the desired fix.
@zsiec, this should be fixed now with the latest commit. I ran your single Stop test case and it worked. This should also address other API calls where it's a POST call that does not require a specific body payload.
thanks for the update @jonathanhperry!
I noticed this when using this SDK to cancel a job, the call to:
returned the error:
there are still some placeholders left in the URL. Please make sure to pass the correct values to this function to replace all placeholders. url=/encoding/encodings/{encoding_id}/stop
After some debugging, I noticed
.Stop()
callsApiClient.Post()
with the following params:https://github.com/bitmovin/bitmovin-api-sdk-go/blob/5a601b88994c6ca30e001cb758e45862d05a19be/encoding/encoding_encodings_api.go#L155-L157
while the signature for
.Post()
is:https://github.com/bitmovin/bitmovin-api-sdk-go/blob/5a601b88994c6ca30e001cb758e45862d05a19be/common/client.go#L176-L178
this raises no type error, of course, as the second and third parameters are of type
interface{}
, but the function is incorrectly sending thereqParams
variadic into theresponseModel
param and the response model into therequestModel
.A quick search points at other places (not exhaustive) that may be similarly effected:
https://github.com/bitmovin/bitmovin-api-sdk-go/blob/5a601b88994c6ca30e001cb758e45862d05a19be/encoding/encoding_encodings_live_api.go#L53-L55
https://github.com/bitmovin/bitmovin-api-sdk-go/blob/5a601b88994c6ca30e001cb758e45862d05a19be/notifications/notifications_api.go#L94-L96
https://github.com/bitmovin/bitmovin-api-sdk-go/blob/5a601b88994c6ca30e001cb758e45862d05a19be/encoding/encoding_manifests_hls_api.go#L90-L92
This issue is quickly reproducible with the following test:
which returns: