{"id":13338726,"url":"https://github.com/javerous/SMJJSONPath","last_synced_at":"2025-03-11T10:31:49.504Z","repository":{"id":69264429,"uuid":"100798203","full_name":"javerous/SMJJSONPath","owner":"javerous","description":"JSONPath implementation in Objective-C","archived":false,"fork":false,"pushed_at":"2025-03-02T00:11:38.000Z","size":210,"stargazers_count":31,"open_issues_count":3,"forks_count":44,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-02T01:20:58.570Z","etag":null,"topics":["ios","jsonpath","macos","objective-c","tvos","watchos"],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/javerous.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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-08-19T14:04:46.000Z","updated_at":"2025-03-02T00:11:37.000Z","dependencies_parsed_at":"2023-09-15T12:17:15.396Z","dependency_job_id":null,"html_url":"https://github.com/javerous/SMJJSONPath","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javerous%2FSMJJSONPath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javerous%2FSMJJSONPath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javerous%2FSMJJSONPath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javerous%2FSMJJSONPath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/javerous","download_url":"https://codeload.github.com/javerous/SMJJSONPath/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243015440,"owners_count":20222082,"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":["ios","jsonpath","macos","objective-c","tvos","watchos"],"created_at":"2024-07-29T19:17:08.846Z","updated_at":"2025-03-11T10:31:49.491Z","avatar_url":"https://github.com/javerous.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\nSMJJSONPath\n===========\n\nSMJJSONPath is a complete JSONPath implementation written in Objective-C. It's a wide adaptation of [`Jayway JsonPath`](https://github.com/json-path/JsonPath) implementation.\n\n\n## Overview\n\nIt supports a wide bunch of functionalities:\n- dot and square bracket syntax\n- inline predicates\n- functions\n- nesting\n\nYou can take a look to the `Jayway JsonPath` documentation for more information.\n\n\n## Adaptation\n\nThis implementation is a tight  adaptation of `Jayway JsonPath`. It respects the original structure and naming, as much as possible. The changes are mainly to be more Objective-C stylized (named parameters, use NSError instead of try-catch-exception, etc.).\n\nThis tight adaptation was done for different reasons:\n- If I wanted to structure something from my own view, I would have started from scratch, and I wouldn't have done it at all : this is a big bunch of code, tests and reflexion to do, more than I want to give to that.\n- The `Jayway JsonPath` project have a pretty good and complete implementation (with some cleaning here and there to do, which are already documented by original developers). It's a good reference, from my point of view.\n- I want to facilitate cherry-picking updates from `Jayway JsonPath` to include them right here.\n\nThis code is currently in sync with the source code in commit [00cfce3](https://github.com/json-path/JsonPath/commit/00cfce33412f57884ea8f2a4e06860a6f8ea970e).\n\n## Query\n\nSimple example:\n\n```\n// Create a SMJJSONPath object\nSMJJSONPath *jsonPath = [[SMJJSONPath alloc] initWithJSONPathString:@\"$.books..author\" error:\u0026error];\n\n// Create a configuration.\nSMJConfiguration *configuration = [SMJConfiguration defaultConfiguration];\n\n// Query a JSON document.\nNSArray *result = [jsonPath resultForJSONFile:fileURL configuration:configuration error:\u0026error];\n\n// That's all.\n```\n\n\n## Update\n\nYou can update a JSON mutable object accordingly to a JSONPath:\n\n```\n// Create a SMJJSONPath object\nSMJJSONPath *jsonPath = [[SMJJSONPath alloc] initWithJSONPathString:@\"$.books..author\" error:\u0026error];\n\n// Create a configuration.\nSMJConfiguration *configuration = [SMJConfiguration defaultConfiguration];\n\n// Read a JSON document with mutable containers.\nid jsonObject = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:\u0026error];\n\n// Update the json.\n[jsonPath updateJSONMutableObject:jsonObject deleteWithConfiguration:configuration error:\u0026error];\n\n\n// The queried path was deleted in jsonObject.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaverous%2FSMJJSONPath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaverous%2FSMJJSONPath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaverous%2FSMJJSONPath/lists"}