Skip to content

Commit

Permalink
Fix list of lists JSON escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfinus committed Jul 14, 2019
1 parent 432357d commit 16c5551
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/org/camunda/latera/bss/utils/JSON.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@ package org.camunda.latera.bss.utils
import groovy.json.JsonSlurper
import groovy.json.JsonOutput
import static org.camunda.latera.bss.utils.DateTimeUtil.*
import static org.camunda.latera.bss.utils.ListUtil.isList
import static org.camunda.latera.bss.utils.MapUtil.isMap

class JSON {
static def escape(obj) {
if (obj instanceof Map) {
if (isMap(obj)) {
LinkedHashMap newMap = [:]
obj.each { k, v ->
newMap[k] = escape(v)
}
return newMap
} else if (obj instanceof List) {
} else if (isList(obj)) {
List newList = []
obj.each { item ->
newList += escape(item)
newList << escape(item)
}
return newList
} else if (isDate(obj)) {
Expand Down

0 comments on commit 16c5551

Please sign in to comment.