{"id":13496799,"url":"https://github.com/apple/swift-openapi-runtime","last_synced_at":"2025-05-16T04:04:07.208Z","repository":{"id":171116256,"uuid":"630567214","full_name":"apple/swift-openapi-runtime","owner":"apple","description":"API package for code generated by Swift OpenAPI Generator.","archived":false,"fork":false,"pushed_at":"2025-05-13T17:24:24.000Z","size":504,"stargazers_count":214,"open_issues_count":1,"forks_count":49,"subscribers_count":105,"default_branch":"main","last_synced_at":"2025-05-13T18:37:40.464Z","etag":null,"topics":["middleware","openapi","swift","transport"],"latest_commit_sha":null,"homepage":"https://swiftpackageindex.com/apple/swift-openapi-runtime/documentation","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apple.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-04-20T16:52:03.000Z","updated_at":"2025-05-13T17:38:04.000Z","dependencies_parsed_at":"2023-10-23T17:40:03.598Z","dependency_job_id":"f668f779-7c07-4b2f-882e-74d6bcde35da","html_url":"https://github.com/apple/swift-openapi-runtime","commit_stats":null,"previous_names":["apple/swift-openapi-runtime"],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apple%2Fswift-openapi-runtime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apple%2Fswift-openapi-runtime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apple%2Fswift-openapi-runtime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apple%2Fswift-openapi-runtime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apple","download_url":"https://codeload.github.com/apple/swift-openapi-runtime/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254464891,"owners_count":22075570,"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":["middleware","openapi","swift","transport"],"created_at":"2024-07-31T19:02:00.161Z","updated_at":"2025-05-16T04:04:07.188Z","avatar_url":"https://github.com/apple.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# Swift OpenAPI Generator Runtime\n\n[![](https://img.shields.io/badge/docc-read_documentation-blue)](https://swiftpackageindex.com/apple/swift-openapi-runtime/documentation)\n[![](https://img.shields.io/github/v/release/apple/swift-openapi-runtime)](https://github.com/apple/swift-openapi-runtime/releases)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fapple%2Fswift-openapi-runtime%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/apple/swift-openapi-runtime)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fapple%2Fswift-openapi-runtime%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/apple/swift-openapi-runtime)\n\nThis library provides common abstractions and helper functions used by the client and server code generated by [Swift OpenAPI Generator][0].\n\n## Overview\n\nIt contains:\n- Common types used in the code generated by the `swift-openapi-generator` package plugin.\n- Protocol definitions for pluggable layers, including [`ClientTransport`](https://swiftpackageindex.com/apple/swift-openapi-runtime/documentation/openapiruntime/clienttransport), [`ServerTransport`](https://swiftpackageindex.com/apple/swift-openapi-runtime/documentation/openapiruntime/servertransport), [`ClientMiddleware`](https://swiftpackageindex.com/apple/swift-openapi-runtime/documentation/openapiruntime/clientmiddleware), and [`ServerMiddleware`](https://swiftpackageindex.com/apple/swift-openapi-runtime/documentation/openapiruntime/servermiddleware).\n\nMany of the HTTP currency types used are defined in the [Swift HTTP Types](https://github.com/apple/swift-http-types) library.\n\n\u003e Tip: Check out the [example projects](https://swiftpackageindex.com/apple/swift-openapi-generator/documentation/swift-openapi-generator/checking-out-an-example-project) focused on middlewares.\n\n## Usage\n\nAdd the package dependency in your `Package.swift`:\n\n```swift\n.package(url: \"https://github.com/apple/swift-openapi-runtime\", from: \"1.0.0\"),\n```\n\nNext, in your target, add `OpenAPIRuntime` to your dependencies:\n\n```swift\n.target(name: \"MyTarget\", dependencies: [\n    .product(name: \"OpenAPIRuntime\", package: \"swift-openapi-runtime\"),\n]),\n```\n\nThe next step depends on your use case.\n\n### Using Swift OpenAPI Generator for code generation\n\nThe generated code depends on types from this library. Check out the adoption guides in the [Swift OpenAPI Generator documentation][1] to see how the packages fit together.\n\n### Implementing transports and middlewares\n\nSwift OpenAPI Generator generates client and server code that is designed to be used with pluggable transports and middlewares.\n\nImplement a new transport or middleware by providing a type that adopts one of the protocols from the runtime library:\n\n* [`ClientTransport`](https://swiftpackageindex.com/apple/swift-openapi-runtime/documentation/openapiruntime/clienttransport)\n* [`ClientMiddleware`](https://swiftpackageindex.com/apple/swift-openapi-runtime/documentation/openapiruntime/clientmiddleware)\n* [`ServerTransport`](https://swiftpackageindex.com/apple/swift-openapi-runtime/documentation/openapiruntime/servertransport)\n* [`ServerMiddleware`](https://swiftpackageindex.com/apple/swift-openapi-runtime/documentation/openapiruntime/servermiddleware)\n\nYou can also publish your transport or middleware as a Swift package to allow others to use it with their generated code.\n\n## Documentation\n\nTo learn more, check out the full [documentation][2].\n\n[0]: https://github.com/apple/swift-openapi-generator\n[1]: https://swiftpackageindex.com/apple/swift-openapi-generator/documentation\n[2]: https://swiftpackageindex.com/apple/swift-openapi-runtime/documentation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapple%2Fswift-openapi-runtime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapple%2Fswift-openapi-runtime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapple%2Fswift-openapi-runtime/lists"}