Skip to content

Fix JSON Pointer resolution for keys containing tildes - #225

Merged
geemus merged 1 commit into
ota42y:masterfrom
ydah:fix-json-pointer-escaping
Oct 24, 2026
Merged

geemus merged 1 commit into
ota42y:masterfrom
ydah:fix-json-pointer-escaping

Conversation

@ydah

@ydah ydah commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Related to #121.

The external file.yaml#/paths/~1resource~1test reference from the original report already resolves on current master.

However, /resource/test and /resource~1test produce the same internal reference.
If both paths exist, the reference can resolve to the wrong Path Item.
References containing ~0 or ~01 can also fail to resolve.

The reference builder escapes / as ~1, but leaves ~ unchanged.

Changes

  • Escape ~ as ~0 before escaping / as ~1.
  • Remove the extra escaping call in the paths/responses loader so each key is escaped once.

The resolver continues to match escaped references against the parsed objects.

@geemus geemus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

@geemus
geemus merged commit 628a776 into ota42y:master Oct 24, 2026
16 checks passed
@ydah
ydah deleted the fix-json-pointer-escaping branch October 25, 2026 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants