{"id":19005286,"url":"https://github.com/f3ath/rfc-6902-dart","last_synced_at":"2026-03-27T04:56:56.664Z","repository":{"id":56838225,"uuid":"332077725","full_name":"f3ath/rfc-6902-dart","owner":"f3ath","description":"JSON Patch (RFC 6902) implementation in Dart","archived":false,"fork":false,"pushed_at":"2024-10-31T17:09:34.000Z","size":18,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-17T10:26:26.160Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/f3ath.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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}},"created_at":"2021-01-22T22:32:28.000Z","updated_at":"2024-10-31T17:09:38.000Z","dependencies_parsed_at":"2024-11-07T05:15:59.845Z","dependency_job_id":null,"html_url":"https://github.com/f3ath/rfc-6902-dart","commit_stats":{"total_commits":5,"total_committers":2,"mean_commits":2.5,"dds":"0.19999999999999996","last_synced_commit":"9a3985f4887bddae73b44f4b70dce1d35d5f43c8"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3ath%2Frfc-6902-dart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3ath%2Frfc-6902-dart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3ath%2Frfc-6902-dart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3ath%2Frfc-6902-dart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f3ath","download_url":"https://codeload.github.com/f3ath/rfc-6902-dart/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250305118,"owners_count":21408919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-08T18:26:57.826Z","updated_at":"2026-03-27T04:56:56.604Z","avatar_url":"https://github.com/f3ath.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [RFC 6902] JSON Patch\nJSON Patch ([RFC 6902]) implementation in Dart.\n\n## Building and encoding to JSON\n```dart\nimport 'dart:convert';\n\nimport 'package:rfc_6902/rfc_6902.dart';\n\nvoid main() {\n  final patch = JsonPatch.build([\n    Test(JsonPointer('/a/b/c'), 'foo'),\n    Remove(JsonPointer('/a/b/c')),\n    Add(JsonPointer('/a/b/c'), ['foo', 'bar']),\n    Replace(JsonPointer('/a/b/c'), 42),\n    Move(JsonPointer('/a/b/c'), JsonPointer('/a/b/d')),\n    Copy(JsonPointer('/a/b/d'), JsonPointer('/a/b/e')),\n  ]);\n  print(jsonEncode(patch));\n}\n```\nproduces\n```\n[\n    {\"op\":\"test\",\"path\":\"/a/b/c\",\"value\":\"foo\"},\n    {\"op\":\"remove\",\"path\":\"/a/b/c\"},\n    {\"op\":\"add\",\"path\":\"/a/b/c\",\"value\":[\"foo\",\"bar\"]},\n    {\"op\":\"replace\",\"path\":\"/a/b/c\",\"value\":42},\n    {\"op\":\"move\",\"from\":\"/a/b/c\",\"path\":\"/a/b/d\"},\n    {\"op\":\"copy\",\"from\":\"/a/b/d\",\"path\":\"/a/b/e\"}\n]\n```\n\n## Parsing JSON and applying to the document\n```dart\nimport 'dart:convert';\n\nimport 'package:rfc_6902/rfc_6902.dart';\n\nvoid main() {\n  const document = {\n    'a': {\n      'b': {'c': 'foo'}\n    }\n  };\n  const json = '''\n   [\n     { \"op\": \"test\", \"path\": \"/a/b/c\", \"value\": \"foo\" },\n     { \"op\": \"remove\", \"path\": \"/a/b/c\" },\n     { \"op\": \"add\", \"path\": \"/a/b/c\", \"value\": [ \"foo\", \"bar\" ] },\n     { \"op\": \"replace\", \"path\": \"/a/b/c\", \"value\": 42 },\n     { \"op\": \"move\", \"from\": \"/a/b/c\", \"path\": \"/a/b/d\" },\n     { \"op\": \"copy\", \"from\": \"/a/b/d\", \"path\": \"/a/b/e\" }\n   ]\n  ''';\n  final patch = JsonPatch(jsonDecode(json));\n  final result = patch.applyTo(document);\n  print(result); // {a: {b: {d: 42, e: 42}}}\n}\n```\n\n[RFC 6902]: https://tools.ietf.org/html/rfc6902","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff3ath%2Frfc-6902-dart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff3ath%2Frfc-6902-dart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff3ath%2Frfc-6902-dart/lists"}