{"id":26005171,"url":"https://github.com/smiley4/ktor-openapi-tools","last_synced_at":"2026-01-11T17:46:38.961Z","repository":{"id":59552844,"uuid":"526907299","full_name":"SMILEY4/ktor-openapi-tools","owner":"SMILEY4","description":"A collection of libraries to simplify API documentation and exploration for Ktor applications. Generates OpenAPI specifications and provides Swagger UI and ReDoc.","archived":false,"fork":false,"pushed_at":"2025-03-31T16:35:06.000Z","size":4032,"stargazers_count":213,"open_issues_count":4,"forks_count":36,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2025-04-03T22:08:27.282Z","etag":null,"topics":["kotlin","ktor","ktor-plugin","openapi","redoc","swagger","swagger-ui"],"latest_commit_sha":null,"homepage":"https://smiley4.github.io/ktor-openapi-tools/","language":"Kotlin","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/SMILEY4.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-20T11:29:42.000Z","updated_at":"2025-04-02T18:07:00.000Z","dependencies_parsed_at":"2024-03-19T13:29:17.929Z","dependency_job_id":"f067f80d-4a76-4dd2-8077-a0468fcd7d38","html_url":"https://github.com/SMILEY4/ktor-openapi-tools","commit_stats":{"total_commits":313,"total_committers":19,"mean_commits":"16.473684210526315","dds":"0.20127795527156545","last_synced_commit":"12cfd091348271776f72fa1acb6c2214542b1d16"},"previous_names":["smiley4/ktor-openapi-tools","smiley4/ktor-swagger-ui"],"tags_count":75,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMILEY4%2Fktor-openapi-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMILEY4%2Fktor-openapi-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMILEY4%2Fktor-openapi-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMILEY4%2Fktor-openapi-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SMILEY4","download_url":"https://codeload.github.com/SMILEY4/ktor-openapi-tools/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248616379,"owners_count":21134070,"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":["kotlin","ktor","ktor-plugin","openapi","redoc","swagger","swagger-ui"],"created_at":"2025-03-05T20:06:02.578Z","updated_at":"2026-01-11T17:46:38.955Z","avatar_url":"https://github.com/SMILEY4.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ktor OpenAPI Tools\n\n[![Version](https://img.shields.io/maven-central/v/io.github.smiley4/ktor-openapi?style=flat\u0026color=blue\u0026logo=apachemaven)](https://search.maven.org/search?q=g:io.github.smiley4%20a:ktor-openapi)\n[![Checks Passing](https://img.shields.io/github/actions/workflow/status/SMILEY4/ktor-openapi-tools/checks.yml?style=flat\u0026logo=github)](https://github.com/SMILEY4/ktor-openapi-tools/actions/workflows/checks.yml)\n[![License](https://img.shields.io/github/license/SMILEY4/ktor-openapi-tools?style=flat\u0026color=teal)](https://github.com/SMILEY4/ktor-openapi-tools/blob/develop/LICENSE)\n\nA collection of libraries to simplify API documentation and exploration for [Ktor](https://ktor.io/) applications. Designed to be non-invasive, they integrate seamlessly with applications without requiring immediate change to existing code while being highly customizable to fit every use case.\n\n**Documentation** can be found [here](https://smiley4.github.io/ktor-openapi-tools/latest/) and in the [wiki](https://github.com/SMILEY4/ktor-openapi-tools/wiki) for older versions.\n\n\n## OpenAPI\n\nKtor plugin to automatically generate [OpenAPI](https://www.openapis.org/) specifications from routes. Additional information can be gradually added to existing routes without requiring major changes to existing code.\n\n- Extends existing Ktor DSL\n- No immediate change to code required\n- Support for [Type-safe routing](https://ktor.io/docs/server-resources.html) / Resources plugin\n- Document webhooks and (limited) options for server-sent events\n- Covers (almost) complete [OpenAPI 3.1.0 Specification](https://swagger.io/specification/)\n- Automatically generates json schemas from kotlin types\n  - Out-of-the-box support for type parameters, inheritance, collections, etc\n  - Usable with reflection or [kotlinx.serialization](https://github.com/Kotlin/kotlinx.serialization)\n  - Supports [Jackson](https://github.com/FasterXML/jackson), [Swagger](https://github.com/swagger-api/swagger-core), [Javax](https://mvnrepository.com/artifact/javax.validation/validation-api)\n    and [Jakarta](https://github.com/jakartaee/validation/tree/main) annotations\n  - Highly configurable and customizable\n\n```kotlin\n// Install and configure the OpenAPI plugin.\ninstall(OpenApi)\n\nrouting {\n    \n    route(\"api.json\") {\n        // Create a route to expose the OpenAPI specification file at `/api.json`.\n        openApi()\n    }\n    \n    get(\"example\", {\n        // Add (optional) information to the route, e.g. a description and responses and response bodies.\n        description = \"An example route\"\n        response {\n            HttpStatusCode.OK to {\n                description = \"A success response\"\n                body\u003cString\u003e()\n            }\n        }\n    }) {\n        // Handle requests as usual.\n        call.respondText(\"Hello World!\")\n    }\n}\n```\n\n\n## Swagger UI\n\nLibrary for Ktor applications to serve [Swagger UI](https://swagger.io/tools/swagger-ui/) - visualize and interact with generated OpenAPI specifications.\n\n- Explore and interact with OpenAPI specifications generated by [`ktor-openapi`](../openapi/index.md) or external specifications\n- Serve bundled Swagger UI\n- Expose multiple \"instances\" of Swagger UI (e.g. for different OpenAPI specifications)\n- All Swagger UI configuration options available\n\n```kotlin\nrouting {\n    \n    route(\"swagger\") {\n        // Expose Swagger UI using OpenAPI specification at `/api.json`.\n        // Path can be relative pointing to specification provided by this application or absolute pointing to an external resource.\n        swaggerUI(\"/api.json\") {\n            // Add configuration for this Swagger UI \"instance\" here.\n        }\n    }\n    \n}\n```\n\n\n## ReDoc\n\nLibrary for Ktor applications to serve [ReDoc](https://github.com/Redocly/redoc) - visualize and interact with generated OpenAPI specifications.\n\n- Explore and interact with OpenAPI specifications generated by [`ktor-openapi`](../openapi/index.md) or external specifications\n- Serve bundled ReDoc page\n- Expose multiple \"instances\" of ReDoc (e.g. for different OpenAPI specifications)\n- All ReDoc configuration options available\n\n```kotlin\nrouting {\n    \n    route(\"redoc\") {\n        // Expose ReDoc showing OpenAPI specification at `/api.json`.\n        // Path can be relative pointing to specification provided by this application or absolute pointing to an external resource.\n      redoc(\"/api.json\") {\n            // Add configuration for this ReDoc \"instance\" here.\n        }\n    }\n    \n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmiley4%2Fktor-openapi-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmiley4%2Fktor-openapi-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmiley4%2Fktor-openapi-tools/lists"}