You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
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
https://github.com/luthermonson/go-proxmox/blob/6c8706ed43a8313502d4fbe4d8bd720fe86c5011/types.go#L543C1
The text was updated successfully, but these errors were encountered: