Skip to content

Fix RFC 6902 conformance cases from #47 - #48

Merged
Havunen merged 1 commit into
Havunen:mainfrom
DicksonWu654:rfc6902-conformance-fixes
Nov 30, 2026
Merged

Havunen merged 1 commit into
Havunen:mainfrom
DicksonWu654:rfc6902-conformance-fixes

Conversation

@DicksonWu654

Copy link
Copy Markdown
Contributor

Thanks for the go-ahead! This fixes the four groups from #47:

  • add at an existing array index now inserts and shifts later elements (- and index == length still append, past the end still fails)
  • A trailing empty pointer token like /foo/ now targets the "" member
  • Unrecognized members in an operation are ignored instead of rejected
  • replace works on an existing member whose value is null

Heads up that this also means a path of just / now points at the "" member, as RFC 6901 says, rather than the root. Happy to split that out if you'd rather keep the old behaviour.

There's a test for each example in the issue, plus the append and out-of-range cases. dotnet test passes on net8.0, net9.0 and net10.0.

Fixes #47

@Havunen
Havunen merged commit 19573ab into Havunen:main Nov 30, 2026
1 check passed
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.

RFC 6902 cases mishandle array adds and reject valid operations

2 participants