diff --git a/addons/play-json/src/test/scala/com/github/tminglei/slickpg/PgPlayJsonSupportSuite.scala b/addons/play-json/src/test/scala/com/github/tminglei/slickpg/PgPlayJsonSupportSuite.scala index 83d3dc04..b387f419 100644 --- a/addons/play-json/src/test/scala/com/github/tminglei/slickpg/PgPlayJsonSupportSuite.scala +++ b/addons/play-json/src/test/scala/com/github/tminglei/slickpg/PgPlayJsonSupportSuite.scala @@ -65,7 +65,7 @@ class PgPlayJsonSupportSuite extends FunSuite { //------------------------------------------------------------------------------ - val testRec1 = JsonBean(33L, Json.parse(""" { "a":101, "b":"aaa", "c":[3,4,5,9] } """), List(Json.parse(""" { "a":101, "b":"aaa", "c":[3,4,5,9] } """)), + val testRec1 = JsonBean(33L, Json.parse(""" { "a":101, "b":"aaa", "c":[3,4,5,9] } """), List(Json.parse(""" { "a":101, "b":"", "c":[3,4,5,9] } """)), JBean("tt", 3), List(JBean("tt", 3))) val testRec2 = JsonBean(35L, Json.parse(""" [ {"a":"v1","b":2}, {"a":"v5","b":3} ] """), List(Json.parse(""" [ {"a":"v1","b":2}, {"a":"v5","b":3} ] """)), JBean("t1", 5), List(JBean("t1", 5))) diff --git a/core/src/main/scala/com/github/tminglei/slickpg/utils/PgTokenHelper.scala b/core/src/main/scala/com/github/tminglei/slickpg/utils/PgTokenHelper.scala index bb5f0047..3fb3a6ee 100644 --- a/core/src/main/scala/com/github/tminglei/slickpg/utils/PgTokenHelper.scala +++ b/core/src/main/scala/com/github/tminglei/slickpg/utils/PgTokenHelper.scala @@ -204,8 +204,10 @@ object PgTokenHelper { } //-- process marker tokens // mark + mark (empty string) - case Marker(m) if (m != "" && level(m) == stack.top.level + 2) => - stack.top.tokens += Chunk("") + case Marker(m) if (m != "" && level(m) == stack.top.level + 2) => { + val m2 = m.substring(0, m.length / 2) + stack.top.tokens += GroupToken(List(Marker(m2), Chunk(""), Marker(m2))) + } // mark + escape case Marker(m) if (m != "" && level(m) != math.round(level(m)) && (tokens(i-1) == Comma || tokens(i-1).isInstanceOf[Open])) => {