mirror of
https://github.com/luthermonson/go-proxmox.git
synced 2026-04-26 17:35:48 +03:00
[GH-ISSUE #102] VirtualMachineCloneOptions{full} should be type bool #16
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/go-proxmox#16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @b- on GitHub (Nov 5, 2023).
Original GitHub issue: https://github.com/luthermonson/go-proxmox/issues/102
Hi,
I'm not sure if there's something I'm overlooking — maybe the IntOrBool type in the same file is relevant here? But I think this should accept a bool
github.com/luthermonson/go-proxmox@6c8706ed43/types.go (L543C1)@jqueuniet commented on GitHub (Nov 5, 2023):
On one hand, I agree a bool would feel intuitive and the official API spec says it's a boolean. On the other hand, the API never uses actual JSON booleans as far as I known, it's always integers with either 1 or 0.
So, that means accepting booleans as user input would require a custom type with custom Marshal/Unmarshal methods. The IntOrBool type does already provide those as far as I can see, so why not use it. Also, this means a potential API breakage if PVE ever starts sending or requesting integers other than 0 or 1, which technically they could do without breaking the current API signatures (but rather unlikely as they do pretend it's booleans in the spec).