eclipse-ee4j / parsson

Parsson Project
Other
10 stars 21 forks source link

should throw JSONPointer:: containsValue an Exception if root or intermediate value not exists #119

Open sebastian-toepfer opened 10 months ago

sebastian-toepfer commented 10 months ago

The spec doesn't say anything what jsonpointer.containsValue should do if the root or intermediate property not exists in target. But it felt wrong for an exception to be thrown, in my opinion it should just return false.

code says more than a thousand words:

boolean contains = Json.createPointer("/test/value")
  .containsValue(Json.createObjectBuilder().add("value");

should not throw any exception it makes containsValue in my opinion useless.

if you agree with it I will try to provide a pr to solve the issue.