Skip to content

[WIP] multiple modifications to an array fails #164

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Copilot
Copy link

@Copilot Copilot AI commented May 27, 2025

Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original issue description:

Traceback (most recent call last):
  File ".../lib/python3.11/site-packages/jsonpointer.py", line 281, in walk
    return doc[part]
           ~~~^^^^^^
IndexError: list index out of range

This are the relevant fields from the patch:

[
    {
        "op": "remove",
        "path": "/ownerships/0"
    },
    {
        "op": "remove",
        "path": "/ownerships/5/current"
    },
    {
        "op": "add",
        "path": "/ownerships/0",
        "value": {
            "share": 64,
            "start": 2023,
            "current": true
        }
    },
    {
        "op": "add",
        "path": "/ownerships/5/end",
        "value": 2023
    }
]

The unmodified document has 6 entries in the array.

Perhaps it's processing the changes in order, so that the first change modifies the array deleting item 0 and then item 5 is not present when it gets to the next change.

Fixes #152.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

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.

multiple modifications to an array fails
2 participants