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

JsonDiff bug found #187

Open
fmoghaddam opened this issue Oct 1, 2024 · 0 comments
Open

JsonDiff bug found #187

fmoghaddam opened this issue Oct 1, 2024 · 0 comments

Comments

@fmoghaddam
Copy link

Expected Behavior

Source:

{
    "store": {
        "a": [
            "v1",
            "v2"
        ]
    }
}

Target:

{
    "store": {
        "a": []
    }
}

running JsonDiff.asJson(source, target) should return:

[
    {
        "op": "remove",
        "path": "/store/a/0",
        "value": "v1"
    },
    {
        "op": "remove",
        "path": "/store/a/1",
        "value": "v2"
    }
]

Actual Behavior

But returns:

[
    {
        "op": "remove",
        "path": "/store/a/0",
        "value": "v1"
    },
    {
        "op": "remove",
        "path": "/store/a/0",
        "value": "v2"
    }
]

Steps to Reproduce the Problem

running JsonDiff.asJson(source, target)

Specifications

Maven
Windows

Library Version: 0.4.16
Language (e.g. Java 1.8, Scala, etc): Java 17

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

No branches or pull requests

1 participant