{"id":50361212,"url":"https://github.com/brody-0125/json_merge_patch","last_synced_at":"2026-05-30T01:30:44.822Z","repository":{"id":349786280,"uuid":"1203997345","full_name":"brody-0125/json_merge_patch","owner":"brody-0125","description":"RFC 7396 JSON Merge Patch for Dart. apply and generate merge patches","archived":false,"fork":false,"pushed_at":"2026-04-07T15:44:13.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-07T16:06:02.376Z","etag":null,"topics":["dart","json","json-merge-patch","patch","rfc7396"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brody-0125.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-07T15:36:23.000Z","updated_at":"2026-04-07T15:42:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/brody-0125/json_merge_patch","commit_stats":null,"previous_names":["brody-0125/json_merge_patch"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/brody-0125/json_merge_patch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brody-0125%2Fjson_merge_patch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brody-0125%2Fjson_merge_patch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brody-0125%2Fjson_merge_patch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brody-0125%2Fjson_merge_patch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brody-0125","download_url":"https://codeload.github.com/brody-0125/json_merge_patch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brody-0125%2Fjson_merge_patch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33677258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","json","json-merge-patch","patch","rfc7396"],"created_at":"2026-05-30T01:30:43.733Z","updated_at":"2026-05-30T01:30:44.810Z","avatar_url":"https://github.com/brody-0125.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json_merge_patch\n\nA Dart implementation of [RFC 7396 — JSON Merge Patch](https://datatracker.ietf.org/doc/html/rfc7396).\n\n[![pub package](https://img.shields.io/pub/v/json_merge_patch.svg)](https://pub.dev/packages/json_merge_patch)\n\n## Features\n\n- **`mergePatch(target, patch)`** — Apply a merge patch to a JSON value.\n- **`generate(source, target)`** — Create a merge patch that turns `source` into `target`.\n- No external dependencies.\n- Dart 3.0+.\n- Passes all 16 test cases from RFC 7396 Appendix A.\n\n## Install\n\n```sh\ndart pub add json_merge_patch\n```\n\n## Usage\n\n```dart\nimport 'package:json_merge_patch/json_merge_patch.dart';\n\nvoid main() {\n  // Apply a merge patch\n  final target = {'a': 'b', 'c': {'d': 'e', 'f': 'g'}};\n  final patch = {'a': 'z', 'c': {'f': null}};\n  final result = mergePatch(target, patch);\n  print(result); // {a: z, c: {d: e}}\n\n  // Generate a merge patch\n  final source = {'a': 'b', 'c': 'd'};\n  final goal = {'a': 'z', 'e': 'f'};\n  final generated = generate(source, goal);\n  print(generated); // {a: z, c: null, e: f}\n}\n```\n\n## How it works\n\nRFC 7396 defines a recursive algorithm for partial JSON updates:\n\n- If the patch is an object, merge it recursively with the target.\n- If a patch value is `null`, remove that key from the target.\n- If the patch is not an object, replace the target entirely.\n\nArrays are always replaced wholesale (not merged element-by-element), and `null` cannot be set as a value — it always means \"delete\".\n\n## Limitations\n\nThese come from the RFC 7396 spec itself:\n\n- **`null` means delete** — you can't set a field's value to `null`.\n- **No array merging** — arrays are replaced entirely.\n- **No conditional updates** — there's no `test` operation like RFC 6902.\n\nIf you need those, see [rfc_6902](https://pub.dev/packages/rfc_6902).\n\n## RFC compliance\n\nImplements the MergePatch algorithm from [RFC 7396 Section 2](https://datatracker.ietf.org/doc/html/rfc7396#section-2). All 16 Appendix A test cases are included and pass.\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n\n---\n\n[한국어 README](README_ko.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrody-0125%2Fjson_merge_patch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrody-0125%2Fjson_merge_patch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrody-0125%2Fjson_merge_patch/lists"}