eclipse-ee4j / eclipse-ee4j/parsson

Syntax error in JSON Pointer

Open
#29 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
17
Forks
25
PR merge metrics
No merged PRs in 30d

Description

JSON Pointer provided by the Jakarta JSON Processing is designed to conform to [RFC 6901](https://tools.ietf.org/html/rfc6901).

RFC 6901 shows us the syntax of JSON Pointer as follows:
```
escaped = "~" ( "0" / "1" )
```

This means any tilde not followed by "0" or "1" is illegal and such case should be judged as a syntax error. Please note that tilde character is excluded from `unescaped` definition.

However `Json#createPointer()` in the Reference Implementation does not throw `JsonException` for the illegal input such as `/~2` and treats such tilde as a normal character.

The API Javadoc of `createPointer` says:
```
JsonException - if jsonPointer is not a valid JSON Pointer
```
This is not a request to fix the problem. I just want to know whether this is a bug or an intended behavior.

Thank you.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.