vttranlina commented on a change in pull request #765:
URL: https://github.com/apache/james-project/pull/765#discussion_r758012481



##########
File path: 
server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/routes/ProcessingContext.scala
##########
@@ -82,14 +84,14 @@ object JsonPath {
         } else if (arrayElementPartPosition == 0) {
           asArrayElementPart(string)
         } else {
-          asArrayElementInAnObject(string, part, arrayElementPartPosition)
+          asArrayElementInAnObject(part, arrayElementPartPosition)
         }
     })
 
   private def asPlainPart(part: String): List[JsonPathPart] = 
List(PlainPart(part))
 
-  private def asArrayElementInAnObject(string: String, part: String, 
arrayElementPartPosition: Int): List[JsonPathPart] =
-    ArrayElementPart.parse(string.substring(arrayElementPartPosition))
+  private def asArrayElementInAnObject(part: String, arrayElementPartPosition: 
Int): List[JsonPathPart] =
+    ArrayElementPart.parse(part.substring(arrayElementPartPosition))

Review comment:
       This change coverage test case `"succeed when first array element is 
present and specific path"`
   ```scala
    "succeed when first array element is present and specific path" in {
         val jsonPath = JsonPath.parse("path[0]/id")
         val json = 
Json.parse("""{"path":[{"id":"1","code":"a"},{"id":"2","code":"b"},{"id":"3","code":"c"}]}""".stripMargin)
         val expected = JsString("1")
   
         jsonPath.evaluate(json) should equal(JsSuccess(expected))
       }
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to