{"id":16937696,"url":"https://github.com/yageek/ygsonencoder","last_synced_at":"2026-05-17T03:45:25.219Z","repository":{"id":136753874,"uuid":"220324395","full_name":"yageek/YGSONEncoder","owner":"yageek","description":":dart: Swift reimplementation of JSONEncoder","archived":false,"fork":false,"pushed_at":"2020-06-22T11:22:53.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-01-26T02:28:41.847Z","etag":null,"topics":["codable","json","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/yageek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-11-07T20:35:40.000Z","updated_at":"2020-06-22T11:22:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"5225ca6b-d4c8-42a0-a705-6b237f27ae09","html_url":"https://github.com/yageek/YGSONEncoder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yageek%2FYGSONEncoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yageek%2FYGSONEncoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yageek%2FYGSONEncoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yageek%2FYGSONEncoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yageek","download_url":"https://codeload.github.com/yageek/YGSONEncoder/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244745715,"owners_count":20503048,"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":["codable","json","swift"],"created_at":"2024-10-13T21:00:01.575Z","updated_at":"2026-05-17T03:45:20.185Z","avatar_url":"https://github.com/yageek.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YGSONEncoder\n\nA reimplementation of JSONEncoder to have `sortedKeys` on pre-iOS 11 (not based on `JSONSerialization`).\n\nCode largely inspired by: \n\n- [apple/swift](https://github.com/apple/swift) for snakeCaseConversion\n- [apple/swift-corelibs-foundation](https://github.com/apple/swift-corelibs-foundation) for pretty printing\n\n## Current features\n- [X] `DateEncodingStrategy`\n- [X] `DataEncodingStrategy`\n- [X] `OutputFormatting`\n- [ ] `KeyEncodingStrategy`\n- [ ] `JSONEncoder.NonConformingFloatEncodingStrategy`\n- [ ] Class inheritance encoding\n\n## Usage\n```swift \nstruct TestUnsortedStruct: Codable {\n       let z: String\n       let b: String\n       let r: String\n       let c: String\n}\n\nlet element = TestUnsortedStruct(z: \"1\", b: \"2\", r: \"3\", c: \"4\")\nlet encoder = YGSONEncoder()\nencoder.outputFormatting = [.sortedKeys]\n\ndo {\n    let data = try encoder.encode(element)\n    } catch let error {\n        print(\"Error: \\(error)\")\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyageek%2Fygsonencoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyageek%2Fygsonencoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyageek%2Fygsonencoder/lists"}