pachadotdev / analogsea

Digital Ocean R client
https://pacha.dev/analogsea/
Apache License 2.0
155 stars 24 forks source link

Json: cannot unmarshal number into Go struct field #220

Closed Kvit closed 1 year ago

Kvit commented 1 year ago
Session Info ```r R version 4.2.1 (2022-06-23) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 22.04.1 LTS Matrix products: default BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 [6] LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] stringr_1.4.1 analogsea_1.0.7.1 RMariaDB_1.2.2 ```
d <- droplet_create()
tag_resource(name="div-2-7-0", resource_id = d$id   )

Error: your request is malformed, please check your syntax: json: cannot unmarshal number into Go struct field Resource.resources.resource_id of type string

Kvit commented 1 year ago

if I change type to character , it works tag_resource(name="mytag", resource_id = as.character( d$id), resource_type = "droplet" )

pachadotdev commented 1 year ago

thx 4 reporting @Kvit here I have converted this to character internally https://github.com/pachadotdev/analogsea/commit/0c949031286e82ba89c9492e991f7fbdfe8d7aa9

you can run remotes::install_github("pachadotdev/analogsea") to have the fix

I'll work on a permanent fix later