Skip to content

JsonPointer.appendProperty(String) does not escape the property name #1145

@Mahoney

Description

@Mahoney

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    2.17Issues planned (at earliest) for 2.17

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions