You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9149a76
Browse filesBrowse the repository at this point in the historyBrowse files
fix: percent-encode keys in local reference pointers (#62)
* fix: percent-encode keys in local reference pointers
The workspace registered keys escaped with only "~0" / "~1", while names recovered
from references were percent-decoded (RFC 6901 section 6). Keys containing "%" or
characters that are percent-encoded in a URI fragment did not round-trip:
- A 2.x server named "a%20b" was written back as "a b", and upgraded to a 3.x
"#/servers/a%20b" reference that points at a server named "a b".
- A 3.x "$ref: '#/servers/a%20b'" missed the workspace entry for "a b" and was
resolved from the raw document into a separate copy of the server.
The workspace now normalizes every location's fragment into one percent-encoded
form, so encoded and unencoded references find the same entry, and registrations
and the 2.x reader's references are built with JsonPointer.EscapeUriFragmentToken.
Registry keys are now compared as strings instead of Uris. Uri equality ignores
the fragment of absolute URIs, so "https://x/s.json#/A" and "https://x/s.json#/B"
shared an entry and the second reference silently resolved to the first schema.
Fixes#61
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix: percent-encode 2.x channel references written by address
AsyncApiChannelReference.SerializeV2 writes a reference to a root channel with
the channel's address, escaped with EscapeToken only. A channel addressed
"a%20b" was written as "#/channels/a%20b", which decodes to "a b" and no longer
resolves. It now uses EscapeUriFragmentToken, as does the 2.x reader when it
points such a reference at the normalized channel key.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments