chibenwa commented on a change in pull request #765:
URL: https://github.com/apache/james-project/pull/765#discussion_r758014137
##########
File path:
server/protocols/jmap-rfc-8621/src/test/scala/org/apache/james/jmap/json/BackReferenceTest.scala
##########
@@ -98,6 +98,29 @@ class BackReferenceTest extends AnyWordSpec with Matchers {
jsonPath.evaluate(json) should equal(JsSuccess(expected))
}
+ "succeed when first array element is present in second path" in {
+ val jsonPath = JsonPath.parse("path/0")
+ val json =
Json.parse("""{"path":[{"id":"1","code":"a"},{"id":"2","code":"b"},{"id":"3","code":"c"}]}""".stripMargin)
+ val expected = Json.parse("""{"id":"1","code":"a"}""")
+
+ jsonPath.evaluate(json) should equal(JsSuccess(expected))
+ }
+ "succeed when pointing to specific array elements and specific path" in {
+ val jsonPath = JsonPath.parse("path/0/id")
Review comment:
What happen if I go out of bound eg with `path/4/id`
--
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]