{"id":13995506,"url":"https://github.com/g-mark/SwiftPath","last_synced_at":"2025-07-22T22:31:03.068Z","repository":{"id":28258410,"uuid":"100985416","full_name":"g-mark/SwiftPath","owner":"g-mark","description":"JSONPath for Swift","archived":false,"fork":false,"pushed_at":"2023-07-08T16:40:47.000Z","size":108,"stargazers_count":58,"open_issues_count":4,"forks_count":15,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2025-06-21T04:37:47.026Z","etag":null,"topics":["json","jsonpath","swift"],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/g-mark.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}},"created_at":"2017-08-21T19:28:21.000Z","updated_at":"2025-02-06T18:01:15.000Z","dependencies_parsed_at":"2024-01-20T18:03:16.078Z","dependency_job_id":"ce58667a-4855-46d0-9d1b-c743b26de1e3","html_url":"https://github.com/g-mark/SwiftPath","commit_stats":{"total_commits":74,"total_committers":6,"mean_commits":"12.333333333333334","dds":0.2432432432432432,"last_synced_commit":"63e6b808696af7f97db729b571c78830afbf925b"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/g-mark/SwiftPath","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-mark%2FSwiftPath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-mark%2FSwiftPath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-mark%2FSwiftPath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-mark%2FSwiftPath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/g-mark","download_url":"https://codeload.github.com/g-mark/SwiftPath/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-mark%2FSwiftPath/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266585663,"owners_count":23952163,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["json","jsonpath","swift"],"created_at":"2024-08-09T14:03:27.116Z","updated_at":"2025-07-22T22:31:02.514Z","avatar_url":"https://github.com/g-mark.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# SwiftPath\n[![Build Status](https://travis-ci.org/g-mark/SwiftPath.svg?branch=develop)](https://travis-ci.org/g-mark/SwiftPath)\n[![Swift 4.2-5.3 compatible](https://img.shields.io/badge/Swift%204.2%20--%205.3-compatible-4BC51D.svg?style=flat)](https://developer.apple.com/swift)\n[![swift-package-manager](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)\n[![CocoaPods compatible](https://img.shields.io/cocoapods/v/SwiftPath.svg)](https://cocoapods.org/pods/SwiftPath)\n[![License: MIT](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://raw.githubusercontent.com/g-mark/SwiftPath/master/LICENSE)\n\nJSONPath for Swift\n\n### Problem\nSometimes, you don't want to hard-code the mapping from JSON to your model. You may want a generic way to model data from different sources. You may want to be able to update your remote data structure without having to update your app binary.\n\n\n### Solution\nSwiftPath allows you to keep your data source **and** your data mapping dynamic.\n\n\n## Installation\n\nSwiftPath is available through [CocoaPods](http://cocoapods.org) and [Carthage](https://github.com/Carthage/Carthage).\n\n### CocoaPods\n\n```ruby\npod \"SwiftPath\"\n```\n\n### Carthage\n\n```\ngithub \"g-mark/SwiftPath\" \"master\"\n```\n\n## Documentation\n\nSwiftPath is a Swift implementation of JSONPath, which allows you to extract a subset of data from a larger chunk of JSON.\n\n### Sipmle usage\n\n\n### Wildcards\nYou can add a wildcard to objects to convert the current object to an array of it's values:\n\n```js\n// Given:\n{\n  \"books\" : {\n    \"one\" : { \"title\": \"one\" },\n    \"two\" : { \"title\": \"two\" },\n    \"three\" : { \"title\": \"three\" }\n  }\n}\n\n// When using this path:\n$.books.*\n\n// Then you'll get this output:\n[ { \"title\": \"one\" }, { \"title\": \"two\" }, { \"title\": \"three\" } ]\n```\n\n### Mapping properties\n\nThis is a difference from the JSONPath 'spec'.  With SwiftPath, you can re-map property names to match your model in code.  When collecting a subset of properties, you can do things like this (renamning the `value` property to `id`):\n\n```js\n// Given:\n[\n  {\"name\": \"one\", \"value\": 1, \"extra\": true },\n  {\"name\": \"one\", \"value\": 2, \"extra\": true },\n  {\"name\": \"one\", \"value\": 3, \"extra\": true }\n]\n\n// When using this path:\n$['name', 'value'=\u003e'id']\n\n// Then you'll get this output:\n[\n  {\"name\": \"one\", \"id\": 1 },\n  {\"name\": \"one\", \"id\": 2 },\n  {\"name\": \"one\", \"id\": 3 }\n]\n```\n\n## Publishing\n\nTo publish a new version of SwiftPath:\n1. Update version number in `SwiftPath.podspec`\n1. Create a release branch off of `production` with version: e.g., `release/#.#.#`\n1. Merge `develop` into release/version branch\n1. Create PR into `production` from release/version branch\n1. Once CI passess, tag it with `#.#.#`, merge into `production`, and delete the release/version branch\n1. Run `pod trunk push SwiftLint.podspec`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg-mark%2FSwiftPath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fg-mark%2FSwiftPath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg-mark%2FSwiftPath/lists"}