Add UnmarshalObjectValue helper function to Reading DTO
Closed this issue ยท 0 comments
lenny-goodell commented
๐ Feature Request
Relevant Package [REQUIRED]
Reading DTODescription [REQUIRED]
ObjectValue JSON gets un-marshaled to a `map[string]any` since the JSON marshaller doesn't have the type info for it. Need a help function that will handle un-marshaling the Object Value to a known typeDescribe the solution you'd like
Add the UnmarshalObjectValue() helper function to the Reading DTOfunc (b BaseReading) UnmarshalObjectValue(target any) error
function must marshal the current reading ObjectValue to JSON and then un-marshal the JSON into the passed in target.
Usage:
target myTYpe{}
err := myReading.UnmarshalObjectValue(&myType)