{"id":24864437,"url":"https://github.com/kevinvitale/anyservice","last_synced_at":"2026-04-28T22:34:33.582Z","repository":{"id":70157617,"uuid":"87852683","full_name":"KevinVitale/AnyService","owner":"KevinVitale","description":null,"archived":false,"fork":false,"pushed_at":"2017-08-08T04:16:07.000Z","size":4,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T18:51:57.252Z","etag":null,"topics":["json","rest-api","restful","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KevinVitale.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-04-10T20:05:36.000Z","updated_at":"2017-08-08T21:43:20.000Z","dependencies_parsed_at":"2023-02-27T09:15:42.628Z","dependency_job_id":null,"html_url":"https://github.com/KevinVitale/AnyService","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KevinVitale/AnyService","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KevinVitale%2FAnyService","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KevinVitale%2FAnyService/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KevinVitale%2FAnyService/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KevinVitale%2FAnyService/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KevinVitale","download_url":"https://codeload.github.com/KevinVitale/AnyService/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KevinVitale%2FAnyService/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32402670,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"ssl_error","status_checked_at":"2026-04-28T19:37:55.688Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","rest-api","restful","swift"],"created_at":"2025-01-31T23:53:30.894Z","updated_at":"2026-04-28T22:34:33.576Z","avatar_url":"https://github.com/KevinVitale.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Define JSON clients with literal strings\n\nThe most easy-to-use JSON library ever. \n\n## Creating clients\n\nCreate your JSON clients with just a string to the base URL.\n\n### JSON Placeholder\n```swift\nlet service: AnyService = \"https://jsonplaceholder.typicode.com\"\n```\n\n### Guild Wars 2\n```swift\nlet gw2: AnyService = \"https://api.guildwars2.com/v2\"\n```\n\n## Fetching results\n\nThe callback returns _a throwable block, that returns a tuple_. \nSimply invoke this throwable block, and then you can then inspect \neither the JSON object returned, the `URLRequest`, or handle any errors.\n\n### Fetch Example\n\n```swift\nlet task = try gw2.fetch(endpoint: \"items\", \"30694\") { request in\n    do {\n        print(\"\\(try request().0)\")\n    } catch {\n        print(\"\\(error)\")\n    }\n    PlaygroundPage.current.finishExecution()\n}\n\ntask.resume()\n```\n\n## Project Scope\n\nMy motivation was to create the simplest, most lightweight \nJSON Swift client around. I limited the code to 80% of\nwhat many developers need to fetch JSON. \n\nSwift's powerful typing system could easily allow for a more\nfeatureful, robust framework in the future. For example, I'd\nlike to explore defining services as a function of their type.\nThis could lead to something that looks like:\n - `AnyService\u003cRESTful\u003e`\n - `AnyService\u003cSocket\u003e`\n - etc.\n\n\n\u003chr/\u003e\n\n### License\nCopyright **2017** — Kevin Vitale\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinvitale%2Fanyservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevinvitale%2Fanyservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinvitale%2Fanyservice/lists"}