When the JSON Pointer is represented as a string, it should not be percent encoded. See section 5 "JSON String Representation" [1] in the RFC.
When the JSON Pointer is included in an URL, as in section 6 "URI Fragment Identifier Representation" [2] in the RFC, it should be percent encoded (just like any other string when it is inserted into an URI) and a "#" prepended, since it is an URI "fragment". This is a separate process and not really part of the JSON Pointer format, since the string representation can be used alone.
I suggest percent encoding be removed from the parse/1. For this, the OTP function http_uri:decode/1 [3] can be used.
Heya, I believe the current implementation is not up to date with the latest versions of the spec, hence the discrepancies. Patches are very welcome! :)
When the JSON Pointer is represented as a string, it should not be percent encoded. See section 5 "JSON String Representation" [1] in the RFC.
When the JSON Pointer is included in an URL, as in section 6 "URI Fragment Identifier Representation" [2] in the RFC, it should be percent encoded (just like any other string when it is inserted into an URI) and a "#" prepended, since it is an URI "fragment". This is a separate process and not really part of the JSON Pointer format, since the string representation can be used alone.
I suggest percent encoding be removed from the
parse/1
. For this, the OTP functionhttp_uri:decode/1
[3] can be used.[1] http://tools.ietf.org/html/rfc6901#section-5 [2] http://tools.ietf.org/html/rfc6901#section-6 [3] http://erlang.org/doc/man/http_uri.html#decode-1