Skip to content

docs: fix RFC-6902 JSON Pointer path conversion#1274

Open
Hashim1999164 wants to merge 1 commit into
immerjs:mainfrom
Hashim1999164:fix/rfc6902-patch-path-docs
Open

docs: fix RFC-6902 JSON Pointer path conversion#1274
Hashim1999164 wants to merge 1 commit into
immerjs:mainfrom
Hashim1999164:fix/rfc6902-patch-path-docs

Conversation

@Hashim1999164

@Hashim1999164 Hashim1999164 commented Jul 22, 2026

Copy link
Copy Markdown

Summary

  • Corrects the patches docs tip for converting Immer path arrays into RFC-6902 JSON Pointers.
  • Uses a leading / ("/" + patch.path.join("/")) so the result matches RFC-6901 JSON Pointers.
  • Notes token escaping for ~ and /, and updates the zh-CN translation to match.

Fixes #1051

Test plan

  • Confirm the English and zh-CN patches pages render the updated sentence
  • Confirm "/" + ["a","b"].join("/") yields /a/b as described in the issue

Prefix the joined path with "/" so normalized patch paths match RFC-6901
JSON Pointers. Also note token escaping for "~" and "/".

Fixes immerjs#1051
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.

Documentation gives incorrect advice for making patches RFC-6902 compliant

1 participant