Closed optik-aper closed 8 months ago
Describe the bug Updates use the same struct as create and therefore do not allow nil values to be passed in or omitted when the JSON body is marshalled for the request.
To Reproduce Steps to reproduce the behavior:
Modify all but one value in the script
scriptID := "b44d064c-e437-4360-adf7-570501c2577e" req := &govultr.StartupScriptReq{ Name: "new name2", Script: "ZWNobyAnaGVsbG8gd29ybGQnCg==", } if err := client.StartupScript.Update(ctx, scriptID, req); err != nil { fmt.Println(err) panic(err.Error()) }
Type
{ "id": "b44d064c-e437-4360-adf7-570501c2577e", "date_created": "2024-01-25T23:08:23+00:00", "date_modified": "2024-01-25T23:20:37+00:00", "name": "new name2", "type": "", "script": "ZWNobyAnaGVsbG8gd29ybGQnCg==" }
Expected behavior Partial updates should be supported per the API documentation
Fixed in #299
Describe the bug Updates use the same struct as create and therefore do not allow nil values to be passed in or omitted when the JSON body is marshalled for the request.
To Reproduce Steps to reproduce the behavior:
Modify all but one value in the script
Type
is wiped out after this update since it is not providedExpected behavior Partial updates should be supported per the API documentation