vultr/govultr

[BUG] - V1 Server/Create changed SUBID from string to int

andrake81 opened this issue · 2 comments

Describe the bug

V1 Server/Create changed SUBID from string to int - this fails our VM creation with this type of errors:

json: cannot unmarshal number into Go struct field Server.SUBID of type string

To Reproduce
Steps to reproduce the behavior:

  1. curl -XPOST "https://api.vultr.com/v1/server/create" -H "API-Key: mykey" --data 'DCID=4' --data 'VPSPLANID=202' --data 'OSID=387'
  2. Get this response back:
    {"SUBID":11111111,"v2_id":"8f9d5536-1111-1111-1111-4c77ae035b12"}

Expected behavior
SUBID used to be string - as with other request, e.g. server/list

Also, the documentation is somewhat confusing - the response body shows SUBID as string - while the the fields' listing shows it as an Integer: https://www.vultr.com/api/v1/#server_create

@andrake81 Thanks for submitting this. You're using API v1 here, which is end of life. There were recently some PHP updates on the core platform which has affected the returned types on v1 and may be the explanation for your issue. My suggestion is to move to using API v2 instead. We will most likely not be making any changes to accommodate v1 at this time. If you wish to keep using v1, govultr won't be compatible.

@andrake81 There were some updates to the v1 API so this might work again. If you test it out, let us know.