Closed arerlend closed 6 years ago
Yeah this just looks like a plain old bug. The JSON PATCH RFC Section 4 (https://tools.ietf.org/html/rfc6902#section-4) points at https://tools.ietf.org/html/rfc6901 to define allowed JSON paths, and I don't see any reason to disallow the .
character.
@jbagga there's already a PR for this, so I'm assigning this bug to you to review & merge.
That's a far better spec. Didn't realize it existed... TIL
Fixed by 70c8133 - thanks!
In /src/Microsoft.AspNetCore.JsonPatch/Internal/PathHelpers.cs:
if (path.Contains(".") || path.Contains("//") || path.Contains(" ") || path.Contains("\\")) { throw new JsonPatchException(Resources.FormatInvalidValueForPath(path), null); }
The spec at jsonpatch.com doesn't ever specify that '.' characters are invalid or must be escaped.