{"id":23695549,"url":"https://github.com/yume190/jsondecodekit","last_synced_at":"2025-09-03T00:31:24.696Z","repository":{"id":56916496,"uuid":"72712403","full_name":"yume190/JSONDecodeKit","owner":"yume190","description":"A Light weight JSON Mapper","archived":false,"fork":false,"pushed_at":"2019-06-21T07:58:52.000Z","size":791,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-22T18:46:45.582Z","etag":null,"topics":["carthage","cocoapods","ios","json","mac","swift"],"latest_commit_sha":null,"homepage":"","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/yume190.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}},"created_at":"2016-11-03T05:39:42.000Z","updated_at":"2019-06-21T07:50:58.000Z","dependencies_parsed_at":"2022-08-20T21:20:24.204Z","dependency_job_id":null,"html_url":"https://github.com/yume190/JSONDecodeKit","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yume190%2FJSONDecodeKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yume190%2FJSONDecodeKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yume190%2FJSONDecodeKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yume190%2FJSONDecodeKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yume190","download_url":"https://codeload.github.com/yume190/JSONDecodeKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231818998,"owners_count":18431232,"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":["carthage","cocoapods","ios","json","mac","swift"],"created_at":"2024-12-30T05:36:51.407Z","updated_at":"2024-12-30T05:36:55.630Z","avatar_url":"https://github.com/yume190.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"JSONDecodeKit\n==========\n\n[![Build Status](https://travis-ci.org/yume190/JSONDecodeKit.svg?branch=master)](https://travis-ci.org/yume190/JSONDecodeKit)\n[![codecov](https://codecov.io/gh/yume190/JSONDecodeKit/branch/master/graph/badge.svg)](https://codecov.io/gh/yume190/JSONDecodeKit)\n[![codebeat badge](https://codebeat.co/badges/8a9cacec-df7b-4e25-8134-25bcc5eeb345)](https://codebeat.co/projects/github-com-yume190-jsondecodekit-master)\n\nA light weight JSON Mapper.\n\nInspired by some JSON libraries :\n\n * [Argo](https://github.com/thoughtbot/Argo)\n * [Himotoki](https://github.com/ikesyo/Himotoki)\n * [Marshal](https://github.com/utahiosmac/Marshal)\n\nAccording to [JSONShootout](https://github.com/bwhiteley/JSONShootout), we testing the json mapping speed, and we have same performance with Marshal.\n\n## Usage\n\n```swift\nstruct Sample:JSONDecodable {\n    let temp:Int\n    static func decode(_ dic: JSON) throws -\u003e Sample {\n        return try Sample(temp: dic \u003c| \"temp\")\n    }\n}\n\nlet json = JSON(any: [\"temp\":1234])\nlet sample:Sample? = try? Sample.decode(json)\n```\n\n---\n\n## Protocols\n\n#### PrimitiveType \n\nPrimitiveType focus on casting type and transform from string \n\n * Casting Type\n```swift\nreturn self as? T\n// return 1 as? Int\n// return \"1\" as? Int\n```\n * Transform From String (`String -\u003e T`)\n```swift\nreturn Int(\"1\")     // \"1\" -\u003e 1\nreturn Int(\"true\")  // \"true\" -\u003e true\n```\n\n * Support Types\n```swift\nInt     Int8    Int16   Int32   Int64\nUInt    UInt8   UInt16  UInt32  UInt64\nFloat   Double\nBool\nString\n```\n\n#### JSONDecodable\n\nJSONDecodable is the protocol, mapping `JSON` to your customize struct.\n\n---\n\n#### Operators\n\n|Operator|Decode element|\n|:------:|:------------:|\n| `\u003c\\|?`  | `T?` |\n| `\u003c\\|`   | `T` |\n| `\u003c\\|\\|`  | `[T]` |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyume190%2Fjsondecodekit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyume190%2Fjsondecodekit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyume190%2Fjsondecodekit/lists"}