{"id":30719833,"url":"https://github.com/dankinsoid/vdcodable","last_synced_at":"2025-10-07T22:10:20.788Z","repository":{"id":56925576,"uuid":"201754681","full_name":"dankinsoid/VDCodable","owner":"dankinsoid","description":"This repository includes some useful tools for Codable protocol and data decoding.","archived":false,"fork":false,"pushed_at":"2025-02-01T07:45:11.000Z","size":393,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-05T02:03:44.246Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dankinsoid.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-08-11T11:15:22.000Z","updated_at":"2025-02-01T07:45:15.000Z","dependencies_parsed_at":"2023-12-25T17:50:14.449Z","dependency_job_id":"bd7d19e7-9f2a-4b96-9346-c6314e866489","html_url":"https://github.com/dankinsoid/VDCodable","commit_stats":{"total_commits":65,"total_committers":4,"mean_commits":16.25,"dds":0.3538461538461538,"last_synced_commit":"9cafa42f64f8f28b7d1b2d2fe590fab96dd4356c"},"previous_names":[],"tags_count":60,"template":false,"template_full_name":null,"purl":"pkg:github/dankinsoid/VDCodable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankinsoid%2FVDCodable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankinsoid%2FVDCodable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankinsoid%2FVDCodable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankinsoid%2FVDCodable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dankinsoid","download_url":"https://codeload.github.com/dankinsoid/VDCodable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankinsoid%2FVDCodable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278854855,"owners_count":26057543,"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-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":[],"created_at":"2025-09-03T10:42:21.463Z","updated_at":"2025-10-07T22:10:20.755Z","avatar_url":"https://github.com/dankinsoid.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VDCodable\n[![CI Status](https://img.shields.io/travis/Voidilov/VDCodable.svg?style=flat)](https://travis-ci.org/Voidilov/VDCodable)\n[![Version](https://img.shields.io/cocoapods/v/VDCodable.svg?style=flat)](https://cocoapods.org/pods/VDCodable)\n[![License](https://img.shields.io/cocoapods/l/VDCodable.svg?style=flat)](https://cocoapods.org/pods/VDCodable)\n[![Platform](https://img.shields.io/cocoapods/p/VDCodable.svg?style=flat)](https://cocoapods.org/pods/VDCodable)\n\n## Description\nThis repository includes some useful tools for `Codable` protocol and data decoding.\n\n## Usage\n\n1. `JSON`\n\n`JSON` enum makes it easy to deal with JSON data.\nUse `String`, `Int` subscripts and dynamic member lookup (\"dot\" syntax) to retrieve a value:\n```swift\nif let name = json.root.array[0]?.name.string {...}\n//or if let name = json[\"root\"][\"array\"][0][\"name\"]?.string {...}\n```\n`JSON` enum uses purely Swift JSON serialization based on [Swift Protobuf](https://github.com/apple/swift-protobuf/tree/master/Sources/SwiftProtobuf) implementation, which is extremely fast.\nConfirms to `Codable`.\n\n2. `VDJSONDecoder`\n\nAn object that decodes instances of a data type from JSON objects.\nMain differences from Foundation `JSONDecoder`:\n- Decoding non-string types from quoted values (like \"true\", \"0.0\")\n- Custom JSON parsing via `(([CodingKey], JSON) -\u003e JSON)` closure\n- Purely Swift and faster\n3. `VDJSONEncoder`\n\nPurely Swift version of `JSONEncoder`.\n\n4. `URLQueryEncoder` and `URLQueryDecoder`\n\nEncoder and decoder for query strings.\n```swift\nstruct SomeStruct: Codable {\n  var title = \"Query_string\"\n  let number = 0\n}\nlet baseURL = URL(string: \"https://base.url\")!\nlet value = SomeStruct() \nlet url = try? URLQueryEncoder().encode(value, for: baseURL)\n//url = \"https://base.url?title=Query_string\u0026number=0\"\n```\n5. `DictionaryDecoder` and `DictionaryEncoder`\n\n6. `NSManagedDecodable`, `NSManagedEncodable` and `NSManagedCodable` protocols\n\nProtocols that make your `NSManagedObject` subclasses confirm to `Codable` protocol.\n\n7. `PlainCodingKey` \n\nSimple `CodingKey` struct.\n\n8. Type reflection for `Decodable` types\n\n```swift\nlet properties: [String: Any.Type] = Mirror.reflect(SomeType.self)\n//or Mirror(SomeType.self).children\n``` \n9. Tools for creating custom encoders/decoders\n\nBased on similar logic when writing different encoders/decoders `DecodingUnboxer` and `EncodingBoxer` protocols were implemented.\nExamples of usage are all encoders in decoders in this repo.\n\n## Installation\n1.  [CocoaPods](https://cocoapods.org)\n\nAdd the following line to your Podfile:\n```ruby\npod 'VDCodable'\n```\nand run `pod update` from the podfile directory first.\n\n2. [Swift Package Manager](https://github.com/apple/swift-package-manager)\n\nCreate a `Package.swift` file.\n```swift\n// swift-tools-version:5.0\nimport PackageDescription\n\nlet package = Package(\n  name: \"SomeProject\",\n  dependencies: [\n    .package(url: \"https://github.com/dankinsoid/VDCodable.git\", from: \"2.13.0\")\n    ],\n  targets: [\n    .target(name: \"SomeProject\", dependencies: [\"VDCodable\"])\n    ]\n)\n```\n```ruby\n$ swift build\n```\n## Author\n\nVoidilov, voidilov@gmail.com\n\n## License\n\nVDCodable is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdankinsoid%2Fvdcodable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdankinsoid%2Fvdcodable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdankinsoid%2Fvdcodable/lists"}