leadpony / jsonp-test-suite

Test Suite for implementations of Jakarta JSON Processing API (JSON-P)
Apache License 2.0
3 stars 2 forks source link

The JsonPointer tests should expect the target to be modified #11

Closed ssilverman closed 3 years ago

ssilverman commented 3 years ago

The Javadocs for JsonPointer don't say that the target can't be modified. What leads me to believe this isn't an oversight is that the JsonPatch Javadocs say explicitly that the target isn't modified, so my thinking is that the omission was on purpose.

I've written my JsonPointer implementation to modify the target, and I think this behaviour is the intended one, at least it's my working assumption.

ssilverman commented 3 years ago

Per your comments in my other issues, I understand that these tests are intended to test the Glassfish JSON-P implementation. This issue might be another case where the implementation disagrees with an interpretation of the Javadocs/API spec.

Philosophical question: Should the implementation be fixed to match the API specification or the API spec be changed to match the implementation? For future readers who haven't seen https://github.com/leadpony/jsonp-test-suite/issues/4, I mentioned there that it might be worthwhile to split the tests into "Glassfish implementation tests" and "JSON-P API spec tests".

leadpony commented 3 years ago

@ssilverman In JSON-P world, JsonValue and its derived object are immutable, like String class in Java language. https://javadoc.io/doc/jakarta.json/jakarta.json-api/latest/jakarta.json/jakarta/json/JsonValue.html

JsonValue represents an immutable JSON value.

Therefore we cannot modify any of them through the API.

leadpony commented 3 years ago

I believe this problem is resolved.