Open mrutkows opened 4 months ago
Note: we already handle the marshaling:
if IsInterfaceASlice(value.Tools) {
arrayTools, ok := value.Tools.([]CDXLegacyCreationTool)
if ok && len(arrayTools) > 0 {
temp["tools"] = arrayTools
}
} else {
tools, ok := value.Tools.(CDXCreationTools)
if ok {
temp["tools"] = tools
}
}
TODO: figure out how to support both current (object)/legacy(array) tools in Metadata.Tools field. Currently, we use an
interface{}
placeholder in ourstruct
bindings which is NOT ideal for many things we are trying to do with entity hashing, normalization, etc.which are both referenced from:
See: https://stackoverflow.com/questions/47057240/parsing-multiple-json-types-into-the-same-struct on possible ways to do this efficiently...