The following code:
JsonPointer
.valueOf("/")
.appendProperty("paths")
.appendProperty("/things")
.appendProperty("post")
.appendProperty("requestBody")
.appendProperty("content")
.appendProperty("application/json")
.appendProperty("schema")
should produce this json pointer:
/paths/~1things/post/requestBody/content/application~1json/schema
Instead it produces this json pointer:
/paths/things/post/requestBody/content/application/json/schema
As you can see, the / at the start of /things and the / in the middle of application/json are not escaped, producing a completely incorrect path.
(You also need to escape ~ correctly as per RFC 69010
The following code:
should produce this json pointer:
/paths/~1things/post/requestBody/content/application~1json/schemaInstead it produces this json pointer:
/paths/things/post/requestBody/content/application/json/schemaAs you can see, the
/at the start of/thingsand the/in the middle ofapplication/jsonare not escaped, producing a completely incorrect path.(You also need to escape
~correctly as per RFC 69010