{"id":23806778,"url":"https://github.com/webrpc/gen-swift","last_synced_at":"2026-06-20T03:31:17.133Z","repository":{"id":186985073,"uuid":"658765071","full_name":"webrpc/gen-swift","owner":"webrpc","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-08T13:14:10.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-01T23:14:29.363Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/webrpc.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}},"created_at":"2023-06-26T12:53:56.000Z","updated_at":"2023-08-08T13:14:15.000Z","dependencies_parsed_at":"2023-08-08T15:07:19.024Z","dependency_job_id":null,"html_url":"https://github.com/webrpc/gen-swift","commit_stats":null,"previous_names":["webrpc/gen-swift"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webrpc%2Fgen-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webrpc%2Fgen-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webrpc%2Fgen-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webrpc%2Fgen-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webrpc","download_url":"https://codeload.github.com/webrpc/gen-swift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240059598,"owners_count":19741688,"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":[],"created_at":"2025-01-01T23:14:29.540Z","updated_at":"2026-06-20T03:31:17.128Z","avatar_url":"https://github.com/webrpc.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gen-swift\n\nThis repo contains the templates used by the `webrpc-gen` CLI to code-generate\nwebrpc Swift client code.\n\n## Scope\n\n`gen-swift` is client-only.\n\n- It generates Swift client code and runtime helpers.\n- It does not generate server handlers or server runtime code.\n- Passing `-server` is rejected as an unsupported option.\n\n## Usage\n\n`gen-swift` is not added to `webrpc-gen` as a built-in `-target=swift` target yet.\n\nUse the Swift generator repo as the target instead:\n\n```sh\nwebrpc-gen -schema=example.ridl -target=github.com/webrpc/gen-swift@latest -client -out=./ExampleClient.swift\n```\n\nOr point `-target` at a local checkout of this repo:\n\n```sh\nwebrpc-gen -schema=example.ridl -target=./local-templates-on-disk -client -out=./ExampleClient.swift\n```\n\n## Generated Surface\n\nGenerated output includes:\n\n- schema constants\n- WebRPC header/version metadata helpers\n- DTOs and enums\n- transport/error helpers\n- service metadata helpers\n- high-level async client methods\n\nThe generated client targets Swift 5.9+. The built-in `URLSession` transport is intended\nfor modern Apple concurrency platforms such as iOS 15+ and macOS 12+.\n\nLow-level helpers remain visible:\n\n- `ServiceAPI.basePath`\n- `ServiceAPI.Method.path`\n- `ServiceAPI.Method.urlPath`\n- `ServiceAPI.Method.encodeRequest(...)`\n- `ServiceAPI.Method.decodeResponse(...)`\n\n## Tooling\n\nThis repo pins the published webrpc tool module in `tools/go.mod` using Go tool\ndependencies.\n\nUse the pinned tools with:\n\n```sh\ngo -C tools tool webrpc-gen\ngo -C tools tool webrpc-test\n```\n\n## Testing\n\nUse the fast generator/unit suite for normal development:\n\n```sh\ngo test ./...\n```\n\nRun the shared Swift integration package separately when you want real generated\nSwift compilation and runtime coverage:\n\n```sh\n./Tests/test.sh\n```\n\nThat script clears stale SwiftPM build artifacts, regenerates\n`Tests/Sources/Generated/Generated.swift` from `Tests/test.ridl`, and runs `swift test`\nagainst a shared SwiftPM package.\n\nThe real external-schema integration remains available as an opt-in Go test:\n\n```sh\nWEBRPC_SWIFT_EXTERNAL_SCHEMA=1 go test ./...\n```\n\nRegenerate and build the tracked client example with:\n\n```sh\nmake -C _examples/ClientExample generate\nmake -C _examples/ClientExample build\nmake -C _examples diff\n```\n\nCI runs the fast Go suite on every PR and push to `master`, and runs the shared Swift\nintegration suite and tracked example checks on `macos-latest`.\n\n## Options\n\n| webrpc-gen option | Description | Default |\n| --- | --- | --- |\n| `-client` | generate client code | unset (`false`) |\n| `-webrpcHeader` | send the standard `Webrpc` header on client requests | `true` |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebrpc%2Fgen-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebrpc%2Fgen-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebrpc%2Fgen-swift/lists"}