From bb360c95e9be406e6b5e434d4ee7e94f99d523a8 Mon Sep 17 00:00:00 2001 From: Jakub Kubrynski Date: Sat, 21 Feb 2015 14:14:45 +0100 Subject: [PATCH] Fixed body parsing - support for lists --- .../main/groovy/io/coderate/accurest/dsl/internal/Body.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accurest-core/src/main/groovy/io/coderate/accurest/dsl/internal/Body.groovy b/accurest-core/src/main/groovy/io/coderate/accurest/dsl/internal/Body.groovy index f9442d0a8a..a61b09e3ac 100644 --- a/accurest-core/src/main/groovy/io/coderate/accurest/dsl/internal/Body.groovy +++ b/accurest-core/src/main/groovy/io/coderate/accurest/dsl/internal/Body.groovy @@ -33,13 +33,13 @@ class Body { this.bodyAsValue = new DslProperty(getClientValue(bodyAsValue), getServerValue(bodyAsValue)) } - private Map getClientValue(GString bodyAsValue) { + private def getClientValue(GString bodyAsValue) { GString clientGString = new GStringImpl(bodyAsValue.values.clone(), bodyAsValue.strings.clone()) Object[] clientValues = bodyAsValue.values.collect { it instanceof DslProperty ? it.clientValue : it } as Object[] return new JsonSlurper().parseText(new GStringImpl(clientValues, clientGString.strings).toString()) } - private Map getServerValue(GString bodyAsValue) { + private def getServerValue(GString bodyAsValue) { GString clientGString = new GStringImpl(bodyAsValue.values.clone(), bodyAsValue.strings.clone()) Object[] serverValues = bodyAsValue.values.collect { it instanceof DslProperty ? it.serverValue : it } as Object[] return new JsonSlurper().parseText(new GStringImpl(serverValues, clientGString.strings).toString())