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

Add missing draft property to Image struct #1487

Open
2 tasks done
PPertl opened this issue Jan 29, 2024 · 0 comments
Open
2 tasks done

Add missing draft property to Image struct #1487

PPertl opened this issue Jan 29, 2024 · 0 comments

Comments

@PPertl
Copy link

PPertl commented Jan 29, 2024

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.85.0

Go environment

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/stepsneck/.cache/go-build'
GOENV='/home/stepsneck/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/stepsneck/go/pkg/mod'
GONOPROXY='github.com/PPertl'
GONOSUMDB='github.com/PPertl'
GOOS='linux'
GOPATH='/home/stepsneck/go'
GOPRIVATE='github.com/PPertl'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.4'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/stepsneck/cloudflare-go/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build448385787=/tmp/go-build -gno-record-gcc-switches'

Expected output

Both the Cloudflare developers and Api docs references a draft field on the response. It is neccesary to verify if an image is uploaded or not using a direct creator uploads (authenticated direct upload URL V2) url.

https://developers.cloudflare.com/images/upload-images/direct-creator-upload/
https://developers.cloudflare.com/api/operations/cloudflare-images-create-authenticated-direct-upload-url-v-2

Actual output

The field is missing from the Image object because it's not present on the Image struct, this way it is not unmarshalled by the json encoder.

Code demonstrating the issue

Api.GetImage(ctx, identifier, id)

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

No branches or pull requests

2 participants