79462111

Date: 2025-02-23 22:51:12
Score: 0.5
Natty:
Report link

If you run your api call inside a function, and use the below method to convert back to a HashMap before returning the api response back to global scope, this will resolve the issue. This function reclusively converts all LazyMap's within the payload.

def convertLazyMap(obj) {
    if (obj instanceof Map) {
        def serializableMap = [:]
        obj.each { key, value ->
            serializableMap[key] = convertLazyMap(value)
        }
        return serializableMap
    } else if (obj instanceof List) {
        return obj.collect { convertLazyMap(it) }
    } else {
        return obj
    }
}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: David Mehoves