{"id":17160478,"url":"https://github.com/mattpolzin/vaporopenapi","last_synced_at":"2025-04-13T13:30:48.665Z","repository":{"id":48361056,"uuid":"230681311","full_name":"mattpolzin/VaporOpenAPI","owner":"mattpolzin","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-25T20:05:19.000Z","size":71,"stargazers_count":57,"open_issues_count":3,"forks_count":8,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-10T06:21:39.145Z","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/mattpolzin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-12-28T23:51:25.000Z","updated_at":"2025-04-04T04:03:17.000Z","dependencies_parsed_at":"2023-09-25T02:45:41.292Z","dependency_job_id":"704d6bca-ad15-4115-9949-0db7bf854ea2","html_url":"https://github.com/mattpolzin/VaporOpenAPI","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattpolzin%2FVaporOpenAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattpolzin%2FVaporOpenAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattpolzin%2FVaporOpenAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattpolzin%2FVaporOpenAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattpolzin","download_url":"https://codeload.github.com/mattpolzin/VaporOpenAPI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248720964,"owners_count":21151020,"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-10-14T22:25:00.416Z","updated_at":"2025-04-13T13:30:48.625Z","avatar_url":"https://github.com/mattpolzin.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VaporOpenAPI\n\nThis is more of a prototype of a library, not a polished or feature-complete API by a long stretch. That said, folks have found it useful and I certainly encourage you to PR fixes and improvements if you also find this library useful!\n\nAs of the release of OpenAPIKit v3.0.0, this library produces OpenAPI v3.1 compatible documents instead of OpenAPI v3.0 compatible documents.\n\nSee https://github.com/mattpolzin/VaporOpenAPIExample for an example of a simple app using this library.\n\nYou use `VaporTypedRoutes.TypedRequest` instead of `Vapor.Request` to form a request context that can be used to build out an OpenAPI description. You use custom methods to attach your routes to the app. These methods mirror the methods available in Vapor already.\n\nYou can use the library like this with Swift Concurrency:\n\n```swift\nenum WidgetController {\n    struct ShowRoute: RouteContext {\n        ...\n    }\n    \n    static func show(_ req: TypedRequest\u003cShowRoute\u003e) try await -\u003e Response {\n        ...\n    }\n}\n\nfunc routes(_ app: Application) {\n    app.get(\n        \"widgets\",\n        \":type\".description(\"The type of widget\"),\n        \":id\".parameterType(Int.self),\n        use: WidgetController.show \n    ).tags(\"Widgets\")\n      .summary(\"Get a widget\")\n}\n```\n\n...and like this with a NIO EventLoopFuture:\n\n```swift\nenum WidgetController {\n    struct ShowRoute: RouteContext {\n        ...\n    }\n    \n    static func show(_ req: TypedRequest\u003cShowRoute\u003e) -\u003e EventLoopFuture\u003cResponse\u003e {\n        ...\n    }\n}\n\nfunc routes(_ app: Application) {\n    app.get(\n        \"widgets\",\n        \":type\".description(\"The type of widget\"),\n        \":id\".parameterType(Int.self),\n        use: WidgetController.show \n    ).tags(\"Widgets\")\n      .summary(\"Get a widget\")\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattpolzin%2Fvaporopenapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattpolzin%2Fvaporopenapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattpolzin%2Fvaporopenapi/lists"}