Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream API wrong type #1061

Closed
2 tasks done
Venoox opened this issue Aug 25, 2022 · 3 comments · Fixed by #1066
Closed
2 tasks done

Stream API wrong type #1061

Venoox opened this issue Aug 25, 2022 · 3 comments · Fixed by #1066
Milestone

Comments

@Venoox
Copy link
Contributor

Venoox commented Aug 25, 2022

Confirmation

  • My issue isn't already found on the issue tracker.
  • I have replicated my issue using the latest version of the library and it is still present.

cloudflare-go version

v0.48.0

Go environment

GO111MODULE="on"
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/tomaz/Library/Caches/go-build"
GOENV="/Users/tomaz/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/tomaz/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/tomaz/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/homebrew/Cellar/go/1.18.5/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/homebrew/Cellar/go/1.18.5/libexec/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.18.5"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/tomaz/GolandProjects/vpl_backend/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/2s/nnn7f20d4md80pjm0wdgdy340000gn/T/go-build3324721000=/tmp/go-build -gno-record-gcc-switches -fno-common"

Expected output

Expected to get StreamVideo struct from the method.

Actual output

json: cannot unmarshal string into Go struct field StreamVideoStatus.result.status.pctComplete of type int

Code demonstrating the issue

api.StreamGetVideo(ctx, cloudflare.StreamParameters{
AccountID: accountId,
VideoID: videoId,
})

Steps to reproduce

api.StreamGetVideo(ctx, cloudflare.StreamParameters{
AccountID: accountId,
VideoID: videoId,
})

References

No response

@Venoox
Copy link
Contributor Author

Venoox commented Aug 25, 2022

This is the actual response. It appears pctComplete is a string instead of integer.

"status": {
 "errorReasonCode": "",
 "errorReasonText": "",
 "pctComplete": "40.000000",
 "state": "ready",
 "step": "encoding"
},

In Cloudflare Docs it shows pctComplete as integer

@jacobbednarz
Copy link
Member

the team confirmed it should be a string and docs will be updated.

@github-actions github-actions bot added this to the v0.49.0 milestone Aug 27, 2022
@github-actions
Copy link
Contributor

This functionality has been released in v0.49.0.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants