Title: Generator generates wrong JSON patch · Issue #155 · java-json-tools/json-patch · GitHub
Open Graph Title: Generator generates wrong JSON patch · Issue #155 · java-json-tools/json-patch
X Title: Generator generates wrong JSON patch · Issue #155 · java-json-tools/json-patch
Description: I have found two objects A and B, where generating patch to change A -> B and applying it back to A creates object different to B. Steps to reproduce Create patch A.json -> B.json Apply this patch to object A to get object Ap (A patched)...
Open Graph Description: I have found two objects A and B, where generating patch to change A -> B and applying it back to A creates object different to B. Steps to reproduce Create patch A.json -> B.json Apply this patch ...
X Description: I have found two objects A and B, where generating patch to change A -> B and applying it back to A creates object different to B. Steps to reproduce Create patch A.json -> B.json Apply this ...
Opengraph URL: https://github.com/java-json-tools/json-patch/issues/155
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Generator generates wrong JSON patch","articleBody":"I have found two objects `A` and `B`, where generating patch to change `A -\u003e B` and applying it back to `A` creates object **different** to `B`.\r\n\r\n### Steps to reproduce\r\n1. Create patch [A.json](https://github.com/java-json-tools/json-patch/files/13228060/A.json) -\u003e [B.json](https://github.com/java-json-tools/json-patch/files/13228066/B.json)\r\n2. Apply this patch to object `A` to get object `Ap` (`A patched`)\r\n\r\n### Actual result\r\n`Ap` is different from `B`. See diff:\r\n\r\n\r\n### What you expect\r\n`Ap` to be the same as `B`.\r\n\r\nI have also used different libraries to check the step 2 (_applying_ the patch) and that part looks OK. So the problem is somewhere in the patch _generator_.\r\n\r\nThis is very nasty bug because the patch is technically valid. Applying it produces object with the correct data model, but it contains wrong data.","author":{"url":"https://github.com/petr-ujezdsky","@type":"Person","name":"petr-ujezdsky"},"datePublished":"2023-11-01T14:50:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/155/json-patch/issues/155"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7869b4e8-ce10-c66f-e004-34a4fd99738f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B29C:1B8E26:A5401B8:D6B54C7:6976542B |
| html-safe-nonce | aebbe0dba70e2c0a7e93db532a090d1e1dcb10a8ef2d55c720663ebaefdc08f8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjlDOjFCOEUyNjpBNTQwMUI4OkQ2QjU0Qzc6Njk3NjU0MkIiLCJ2aXNpdG9yX2lkIjoiNzU1ODk0MDUzMjAyMTgxMDIxOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4366a5e087a051db46c591afdd361dd092666ee544dfb55445202b00eb90d131 |
| hovercard-subject-tag | issue:1972530025 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/java-json-tools/json-patch/155/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ab4ab63d44397f8be450c0173746aa1c93a1feb58536686cca221c5ee819aa9e/java-json-tools/json-patch/issues/155 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ab4ab63d44397f8be450c0173746aa1c93a1feb58536686cca221c5ee819aa9e/java-json-tools/json-patch/issues/155 |
| og:image:alt | I have found two objects A and B, where generating patch to change A -> B and applying it back to A creates object different to B. Steps to reproduce Create patch A.json -> B.json Apply this patch ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | petr-ujezdsky |
| hostname | github.com |
| expected-hostname | github.com |
| None | 032152924a283b83384255d9489e7b93b54ba01da8d380b05ecd3953b3212411 |
| turbo-cache-control | no-preview |
| go-import | github.com/java-json-tools/json-patch git https://github.com/java-json-tools/json-patch.git |
| octolytics-dimension-user_id | 28316821 |
| octolytics-dimension-user_login | java-json-tools |
| octolytics-dimension-repository_id | 8911984 |
| octolytics-dimension-repository_nwo | java-json-tools/json-patch |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 8911984 |
| octolytics-dimension-repository_network_root_nwo | java-json-tools/json-patch |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5b577f6be6482e336e3c30e8daefa30144947b17 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width