Skip to content

honor case_sensitive in detach_path for object members - #1121

Open
nabhan06 wants to merge 1 commit into
DaveGamble:masterfrom
nabhan06:detach-path-case-sensitive
Open

nabhan06 wants to merge 1 commit into
DaveGamble:masterfrom
nabhan06:detach-path-case-sensitive

Conversation

@nabhan06

Copy link
Copy Markdown

detach_path always calls cJSON_DetachItemFromObject, so cJSONUtils_ApplyPatchesCaseSensitive resolves the target of remove, replace and move case-insensitively even though the rest of the patch code honors the flag. Applying [{"op":"remove","path":"/role"}] to {"Role":"user","role":"admin"} removes "Role" and leaves "role":"admin" in place, and removing "/a" from {"A":1} succeeds when it should fail. This picks cJSON_DetachItemFromObjectCaseSensitive when case_sensitive is set, the same way apply_patch already handles the add side, and adds patch test cases for it.

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.

1 participant