-
Notifications
You must be signed in to change notification settings - Fork 904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] vim25 JSON does not support dateTime and binary in OptionValue #3127
Comments
karaatanassov
added a commit
to karaatanassov/govmomi
that referenced
this issue
May 16, 2023
This change adds support for `binary` and `dateTime` in JSON. For `binary` golang `[]byte` JSON serialization matches the vCenter format. Thus adding the name ot the maps was enough. For `dateTime` the format of `time.Time` `Marshaler` and `Unmarshaler` matches vCenter format. The discriminator code required support for custom marshaling logic. In addition the name had to be mapped. Closes: vmware#3127
12 tasks
karaatanassov
added a commit
to karaatanassov/govmomi
that referenced
this issue
May 24, 2023
This change adds support for `binary` and `dateTime` in JSON. For `binary` golang `[]byte` JSON serialization matches the vCenter format. Thus adding the name ot the maps was enough. For `dateTime` the format of `time.Time` `Marshaler` and `Unmarshaler` matches vCenter format. The discriminator code required support for custom marshaling logic. In addition the name had to be mapped. To support `nil` value fields move `assertEqual` to use `reflect.DeepEqual`. Closes: vmware#3127
karaatanassov
added a commit
to karaatanassov/govmomi
that referenced
this issue
May 26, 2023
This change adds support for `binary` and `dateTime` in JSON. For `binary` golang `[]byte` JSON serialization matches the vCenter format. Thus adding the name ot the maps was enough. For `dateTime` the format of `time.Time` `Marshaler` and `Unmarshaler` matches vCenter format. The discriminator code required support for custom marshaling logic. In addition the name had to be mapped. To support `nil` value fields move `assertEqual` to use `reflect.DeepEqual`. Closes: vmware#3127
priyanka19-98
pushed a commit
to priyanka19-98/govmomi
that referenced
this issue
Jan 17, 2024
This change adds support for `binary` and `dateTime` in JSON. For `binary` golang `[]byte` JSON serialization matches the vCenter format. Thus adding the name ot the maps was enough. For `dateTime` the format of `time.Time` `Marshaler` and `Unmarshaler` matches vCenter format. The discriminator code required support for custom marshaling logic. In addition the name had to be mapped. To support `nil` value fields move `assertEqual` to use `reflect.DeepEqual`. Closes: vmware#3127
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
The json serialization code for vim25 does not support
binary
anddateTime
where "any" is used. For example this is theOptionValue
in VMsExpected behavior
dateTime nad binary should be supported like following in JSON
Affected version
v.0.30.4
Screenshots/Debug Output
These types are missing in code https://github.com/vmware/govmomi/blob/main/vim25/types/json_encoding.go#L32
The text was updated successfully, but these errors were encountered: