{"id":32143282,"url":"https://github.com/pitiphong-p/urlqueryitemencoder","last_synced_at":"2025-10-21T07:56:10.982Z","repository":{"id":26636580,"uuid":"108156443","full_name":"pitiphong-p/URLQueryItemEncoder","owner":"pitiphong-p","description":"A Swift Encoder for encoding any Encodable value into an array of URLQueryItem.","archived":false,"fork":false,"pushed_at":"2022-09-05T21:11:54.000Z","size":32,"stargazers_count":65,"open_issues_count":1,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-21T07:56:01.713Z","etag":null,"topics":["encodable","encoder","query","swift","url"],"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/pitiphong-p.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":"2017-10-24T16:50:09.000Z","updated_at":"2025-09-22T05:05:44.000Z","dependencies_parsed_at":"2022-08-07T12:00:48.871Z","dependency_job_id":null,"html_url":"https://github.com/pitiphong-p/URLQueryItemEncoder","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/pitiphong-p/URLQueryItemEncoder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pitiphong-p%2FURLQueryItemEncoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pitiphong-p%2FURLQueryItemEncoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pitiphong-p%2FURLQueryItemEncoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pitiphong-p%2FURLQueryItemEncoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pitiphong-p","download_url":"https://codeload.github.com/pitiphong-p/URLQueryItemEncoder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pitiphong-p%2FURLQueryItemEncoder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280225808,"owners_count":26293888,"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-21T02:00:06.614Z","response_time":58,"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":["encodable","encoder","query","swift","url"],"created_at":"2025-10-21T07:56:06.140Z","updated_at":"2025-10-21T07:56:10.975Z","avatar_url":"https://github.com/pitiphong-p.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# URLQueryItemEncoder\n![Platform](https://img.shields.io/badge/Platforms-iOS%20%7C%20macOS%20%7C%20Linux-4E4E4E.svg?colorA=EF5138)\n[![Swift support](https://img.shields.io/badge/Swift-4.0-lightgrey.svg?colorA=EF5138\u0026colorB=4E4E4E)](#requirements)\n[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/URLQueryItemEncoder.svg?style=flat\u0026label=CocoaPods)](https://cocoapods.org/pods/URLQueryItemEncoder)\n![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-brightgreen.svg?style=flat\u0026colorB=64A5DE)\n![Swift Package Manager compatible](https://img.shields.io/badge/SPM-compatible-brightgreen.svg?style=flat\u0026colorB=64A5DE)\n[![Twitter](https://img.shields.io/badge/twitter-@pitiphong__p-blue.svg?style=flat\u0026colorB=64A5DE\u0026label=Twitter)](http://twitter.com/pitiphong_p)\n\n\nA Swift `Encoder` for encoding any `Encodable` value into an array of `URLQueryItem`. As part of the [SE-0166](https://github.com/apple/swift-evolution/blob/master/proposals/0166-swift-archival-serialization.md), Swift has a foundation for any type to define how its value should be archived. This encoder allows you to encode those value into an array of `URLQueryItem` which represent that value in one command.\n\n```swift\nstruct Language {\n  let name: String\n  let age: Int\n}\n\nlet person = Language(name: \"Swift\", age: 4)\nlet encoder = URLQueryItemEncoder()\nlet items = try encoder.encode(person)\n// items == [URLQueryItem(name: \"name\", value: \"Swift\"), URLQueryItem(name: \"age\", value: \"4\")]\n```\n\n# Requirements\n- iOS 8+\n- macOS 10.10+\n- Swift 4.0+\n\n# Installation\n## Manually\nThis project comes with built in *`URLQueryItemEncoder framework`* target. You can drag `URLQueryItemEncoder.xcproj` file into your project, add `URLQueryItemEncoder framework` target as a target dependency and link/embed that framework. and Voila!!!\n```swift\nimport URLQueryItemEncoder\n```\nOr you can copy the `URLQueryItemEncoder.swift` file into your project.\n\n## CocoaPods\nAdd the following to your `Podfile`\n```ruby\npod 'URLQueryItemEncoder'\nuse_frameworks!\n```\n## Carthage\nAdd the following to your `Cartfile`\n```ruby\ngithub \"pitiphong-p/URLQueryItemEncoder\"\n```\n\n## Swift Package Manager\nYou can use [Swift Package Manager](https://swift.org/package-manager/) and specify dependency in `Package.swift` by adding this:\n```swift\ndependencies: [\n    .Package(url: \"https://github.com/pitiphong-p/URLQueryItemEncoder.git\", majorVersion: 0)\n]\n```\n\n\n# Usage\nThe `URLQueryItemEncoder` has a simple and familiar API. It has only 1 method for performing the encoding and 1 strategy for choosing how to encode the `Array Index` key.\n\n```swift\nlet encoder = URLQueryItemEncoder()\nlet items = try encoder.encode(person)\n```\n\n# Contact\n### Pitiphong Phongpattranont\n- [@pitiphong_p on Twitter](https://twitter.com/pitiphong_p)\n\n# License\n`URLQueryItemEncoder` is released under an MIT License.  \nCopyright © 2017-present Pitiphong Phongpattranont.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpitiphong-p%2Furlqueryitemencoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpitiphong-p%2Furlqueryitemencoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpitiphong-p%2Furlqueryitemencoder/lists"}