Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix patch_pre_transformed_spec when object is replaced by an array #398

Merged
merged 1 commit into from
Sep 26, 2023

Conversation

jonmmease
Copy link
Collaborator

In the patch pre-transformed spec logic, when a JSON object is replaced by an array, it could sometimes happen that the result would be an object with integer keys (e.g. {"0": "A", "1": "BB"} instead of an array (e.g. ["A", "BB"]). I think this is a natural consequence of how JSON patching works, so I don't think it's necessarily a bug in json-patch.

This PR identifies such objects and converts them to proper arrays.

@jonmmease jonmmease merged commit 1f1a483 into main Sep 26, 2023
30 checks 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.

1 participant