{"id":29964862,"url":"https://github.com/bb441db/ktor-client-codegen","last_synced_at":"2025-08-04T01:08:02.744Z","repository":{"id":307979919,"uuid":"337186106","full_name":"bb441db/ktor-client-codegen","owner":"bb441db","description":"Generate HTTP request calls for ktor-client using annotation processing","archived":false,"fork":false,"pushed_at":"2021-02-08T19:32:03.000Z","size":74,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-03T12:46:01.560Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bb441db.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-02-08T19:27:34.000Z","updated_at":"2023-03-25T03:49:48.000Z","dependencies_parsed_at":"2025-08-03T12:46:07.447Z","dependency_job_id":"96813331-87b1-40c4-877b-d8255989f5b0","html_url":"https://github.com/bb441db/ktor-client-codegen","commit_stats":null,"previous_names":["bb441db/ktor-client-codegen"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/bb441db/ktor-client-codegen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bb441db%2Fktor-client-codegen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bb441db%2Fktor-client-codegen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bb441db%2Fktor-client-codegen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bb441db%2Fktor-client-codegen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bb441db","download_url":"https://codeload.github.com/bb441db/ktor-client-codegen/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bb441db%2Fktor-client-codegen/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268635318,"owners_count":24281941,"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","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-08-04T01:05:40.319Z","updated_at":"2025-08-04T01:08:02.723Z","avatar_url":"https://github.com/bb441db.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ktor Code Generation\n\nGenerates code for [ktor client](https://ktor.io/docs/clients-index.html) HTTP requests \n\n## Example\n\n```kt\ndata class Bar(val id: Int)\n\n@Ktor\n@Header(\"Accept\", \"application/json\")\ninterface FooService {\n    @Get(\"/bar/:id\")\n    suspend fun bar(id: Int): Bar\n}\n\n// Generates\n\nimport io.ktor.client.HttpClient\nimport io.ktor.client.request.`get`\nimport io.ktor.client.request.url\nimport kotlin.Int\n\npublic class FooServiceImpl(\n  private val client: HttpClient\n) : FooService {\n  public override suspend fun bar(id: Int): Bar = this.client.`get` {\n    url(buildString {\n      append(\"/bar/\")\n      append(id)\n    })\n    header(\"Accept\", \"application/json\")\n  }\n}\n```\n\n## Reified generic type response\n\n```kt\ndata class Bar(val id: Int)\n\n@Ktor\n@Header(\"Accept\", \"application/json\")\ninterface FooService {\n    @Get(\"/bar/:id\")\n    suspend fun bar(id: Int): HttpResponse\n}\n\nsuspend inline fun \u003creified T: Any\u003e FooService.inlineBar(id: Int): T = bar(id).receive()\n```\n\n## Annotations\n|Name|Allowed|Description|\n|---|---|---|\n|`@Ktor`|interface|Marks interface for code generation|\n|`@Request(method: String, url: String)`|method|Define the HTTP method and URL)|\n|`@Delete(url: String)`|method|Short-handed version of `@Request`|\n|`@Get(url: String)`|method|Short-handed version of `@Request`|\n|`@Head(url: String)`|method|Short-handed version of `@Request`|\n|`@Options(url: String)`|method|Short-handed version of `@Request`|\n|`@Patch(url: String)`|method|Short-handed version of `@Request`|\n|`@Post(url: String)`|method|Short-handed version of `@Request`|\n|`@Put(url: String)`|method|Short-handed version of `@Request`|\n|`@Header(name: String, value: String)`|method, interface|Single HTTP header|\n|`@Headers(vararg values: String)`|method, interface|Multiple HTTP headers|\n|`@Param(name: String = \"\")`|method parameter|Override the name of a parameter, this is used when finding a parameter for URL template placeholders, e.g `/bar/:id`|\n|`@Timeout(connect: Long = -1, request: Long = -1, socket: Long = -1)`|method|Define connect, socket and/or request timeouts|","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbb441db%2Fktor-client-codegen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbb441db%2Fktor-client-codegen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbb441db%2Fktor-client-codegen/lists"}