{"id":18285713,"url":"https://github.com/remexre/json-pointer","last_synced_at":"2025-08-31T12:35:28.268Z","repository":{"id":96048373,"uuid":"92547683","full_name":"remexre/json-pointer","owner":"remexre","description":"A crate for parsing and using JSON pointers, as specified in RFC 6901.","archived":false,"fork":false,"pushed_at":"2023-12-22T14:43:27.000Z","size":33,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T07:44:01.231Z","etag":null,"topics":["json-pointer","rfc6901"],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/remexre.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2017-05-26T20:53:02.000Z","updated_at":"2022-10-01T00:33:39.000Z","dependencies_parsed_at":"2024-12-22T21:24:21.084Z","dependency_job_id":"707d3520-bc40-4cf3-8ecb-3749cc7bff26","html_url":"https://github.com/remexre/json-pointer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/remexre/json-pointer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remexre%2Fjson-pointer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remexre%2Fjson-pointer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remexre%2Fjson-pointer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remexre%2Fjson-pointer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remexre","download_url":"https://codeload.github.com/remexre/json-pointer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remexre%2Fjson-pointer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259584751,"owners_count":22880194,"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":["json-pointer","rfc6901"],"created_at":"2024-11-05T13:17:31.914Z","updated_at":"2025-06-13T05:04:08.775Z","avatar_url":"https://github.com/remexre.png","language":"Rust","readme":"# json-pointer\n\nA crate for parsing and using JSON pointers, as specified in [RFC\n6901](https://tools.ietf.org/html/rfc6901). Unlike the `pointer` method\nbuilt into `serde_json`, this handles both validating JSON Pointers before\nuse and the URI Fragment Identifier Representation.\n\n[![Build Status](https://travis-ci.org/remexre/json-pointer.svg?branch=master)](https://travis-ci.org/remexre/json-pointer)\n[![crates.io](https://img.shields.io/crates/v/json-pointer.svg)](https://crates.io/crates/json-pointer)\n[![Documentation](https://docs.rs/json-pointer/badge.svg)](https://docs.rs/json-pointer)\n\n## Creating a JSON Pointer\n\nJSON pointers can be created with a literal `[\u0026str]`, or parsed from a `String`.\n\n```rust\nlet from_strs = JsonPointer::new([\n    \"foo\",\n    \"bar\",\n]);\nlet parsed = \"/foo/bar\".parse::\u003cJsonPointer\u003c_, _\u003e\u003e().unwrap();\n\nassert_eq!(from_strs.to_string(), parsed.to_string());\n}\n```\n\n## Using a JSON Pointer\n\nThe `JsonPointer` type provides `.get()` and `.get_mut()`, to get references\nand mutable references to the appropriate value, respectively.\n\n```rust\nlet ptr = \"/foo/bar\".parse::\u003cJsonPointer\u003c_, _\u003e\u003e().unwrap();\n\nlet document = json!({\n    \"foo\": {\n        \"bar\": 0,\n        \"baz\": 1,\n    },\n    \"quux\": \"xyzzy\"\n});\n\nlet indexed = ptr.get(\u0026document).unwrap();\n\nassert_eq!(indexed, \u0026json!(0));\n```\n\n## URI Fragment Identifier Representation\n\nJSON Pointers can be embedded in the fragment portion of a URI. This is the\nreason why most JSON pointer libraries require a `#` character at the beginning\nof a JSON pointer. The crate will detect the leading `#` as an indicator to\nparse in URI Fragment Identifier Representation. Note that this means that this\ncrate does not support parsing full URIs.\n\n```rust\nlet str_ptr = \"/f%o\".parse::\u003cJsonPointer\u003c_, _\u003e\u003e().unwrap();\nlet uri_ptr = \"#/f%25o\".parse::\u003cJsonPointer\u003c_, _\u003e\u003e().unwrap();\n\nassert_eq!(str_ptr, uri_ptr);\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremexre%2Fjson-pointer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremexre%2Fjson-pointer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremexre%2Fjson-pointer/lists"}