cloudflare-go icon indicating copy to clipboard operation
cloudflare-go copied to clipboard

Add missing draft property to Image struct

Open PPertl opened this issue 1 year ago • 0 comments

Confirmation

  • [X] My issue isn't already found on the issue tracker.
  • [X] 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)

PPertl avatar Jan 29 '24 20:01 PPertl