{"id":13496801,"url":"https://github.com/swift-server/swift-openapi-vapor","last_synced_at":"2025-03-28T19:31:07.692Z","repository":{"id":171269429,"uuid":"633526066","full_name":"swift-server/swift-openapi-vapor","owner":"swift-server","description":"Vapor Bindings for the OpenAPI Generator","archived":false,"fork":false,"pushed_at":"2024-12-18T13:31:02.000Z","size":83,"stargazers_count":86,"open_issues_count":3,"forks_count":11,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-03-23T00:20:30.123Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/swift-server.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-27T17:35:37.000Z","updated_at":"2025-02-27T17:17:10.000Z","dependencies_parsed_at":"2024-01-06T19:23:23.526Z","dependency_job_id":"67ec9b63-445b-4174-a20a-bab20ba56d38","html_url":"https://github.com/swift-server/swift-openapi-vapor","commit_stats":null,"previous_names":["swift-server/swift-openapi-vapor"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swift-server%2Fswift-openapi-vapor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swift-server%2Fswift-openapi-vapor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swift-server%2Fswift-openapi-vapor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swift-server%2Fswift-openapi-vapor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swift-server","download_url":"https://codeload.github.com/swift-server/swift-openapi-vapor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246088435,"owners_count":20721684,"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":"2024-07-31T19:02:00.205Z","updated_at":"2025-03-28T19:31:07.412Z","avatar_url":"https://github.com/swift-server.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# Swift OpenAPI Vapor\n\nThis package provides Vapor Bindings for the [OpenAPI generator](https://github.com/apple/swift-openapi-generator).\n\n## Usage\n\nIn `entrypoint.swift` add:\n\n```swift\n// Create a Vapor OpenAPI Transport using your application.\nlet transport = VaporTransport(routesBuilder: app)\n\n// Create an instance of your handler type that conforms the generated protocol\n// defining your service API.\nlet handler = MyServiceAPIImpl()\n\n// Call the generated function on your implementation to add its request\n// handlers to the app.\ntry handler.registerHandlers(on: transport)\n```\n\n## Documentation\n\nTo get started, check out the full [documentation][docs-generator], which contains step-by-step tutorials!\n\nAdditionally, see the [request injection tutorial][request-injection-tutorial] to learn how you can use [swift-dependencies] to inject `Request` into `APIProtocol`:\n\n```swift\nstruct MyAPIProtocolImpl: APIProtocol {\n    @Dependency(\\.request) var request\n\n\n    func myOpenAPIEndpointFunction() async throws -\u003e Operations.myOperation.Output {\n        /// Use `request` as if this is a normal Vapor endpoint function\n        request.logger.notice(\n            \"Got a request!\",\n            metadata: [\n                \"request\": .stringConvertible(request)\n            ]\n        )\n    }\n}\n```\n\n[docs-generator]: https://swiftpackageindex.com/apple/swift-openapi-generator/documentation\n[swift-dependencies]: https://github.com/pointfreeco/swift-dependencies\n[request-injection-tutorial]: https://swiftpackageindex.com/swift-server/swift-openapi-vapor/1.0.1/tutorials/swift-openapi-vapor/requestinjection\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswift-server%2Fswift-openapi-vapor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswift-server%2Fswift-openapi-vapor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswift-server%2Fswift-openapi-vapor/lists"}