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
with how gofish decodes Redfish responses, there's not an easy way to check if a value is actually null or the Go default for null (e.g. if a float is 0 or null, if a field is an empty string or does not exist)
Do you have suggestions? Am I missing something glaringly obvious?
The text was updated successfully, but these errors were encountered:
There's not really a great way that I'm aware of. The library would need to do something like using a *string type for all string fields like aws-sdk-go does. That can be more confusing, and a bigger change, than it's worth.
Another (pretty invasive) option would be to use something like Rust's Option pattern and have something like:
typeOption[Tany] struct {
SomeTNonebool
}
With some custom JSON marshaling to figure out if there is a value present or not.
The simplest option might be to see where this is actually needed, then add something to that specific object's JSON marshaling to do that detection and set a flag or something.
I haven't run in to an issue myself where this has been necessary, but I could see it being necessary under certain conditions. But not enough to need to make major changes to the library.
I suppose one other option is to read in the RawJson of the object and do some string parsing for the presence of the value you care about. Kind of simplistic, but also simple enough that it could work in the places where you really need to know.
with how gofish decodes Redfish responses, there's not an easy way to check if a value is actually null or the Go default for null (e.g. if a float is 0 or null, if a field is an empty string or does not exist)
Do you have suggestions? Am I missing something glaringly obvious?
The text was updated successfully, but these errors were encountered: