Skip to content

[Feat] Ktor DI integration - Ktor 3.4#2294

Merged
arnaudgiuliani merged 14 commits into4.2.0from
feat_ktor_di_3.2
Jan 20, 2026
Merged

[Feat] Ktor DI integration - Ktor 3.4#2294
arnaudgiuliani merged 14 commits into4.2.0from
feat_ktor_di_3.2

Conversation

@arnaudgiuliani
Copy link
Copy Markdown
Member

Following up #2250

Added fixes about Key resolution

luozejiaqun and others added 10 commits October 23, 2024 10:42
Ktor DI Bridge Implementation
  - Added KoinDependencyMapExtension implementing Ktor 3.2's DependencyMapExtension interface
  - Registered via SPI in META-INF/services/io.ktor.server.plugins.di.DependencyMapExtension

Koin can resolve Ktor DI dependencies via KtorDIExtension resolution extension.
  - There is a potential problem with runBlocking usage

When dependency is not found, each library is delegating to the other in an infinite loop

Fixed a problem in CoreResolver that was not resolving extensions

Created a sample application to show usage.
…Ktor DI. Explicit options for bridging Ktor -> Koin & Koin -> Ktor
@arnaudgiuliani
Copy link
Copy Markdown
Member Author

@arnaudgiuliani arnaudgiuliani added status:wait_feedback Need more details or follow-up kotlin-issue Related to Kotlin issue under the hood labels Oct 20, 2025
@arnaudgiuliani arnaudgiuliani added this to the 4.2.0 milestone Oct 20, 2025
@volo-droid
Copy link
Copy Markdown

@arnaudgiuliani arnaudgiuliani deleted the branch 4.2.0 October 28, 2025 15:44
@arnaudgiuliani arnaudgiuliani changed the base branch from 4.1.2 to 4.2.0 October 28, 2025 15:47
@arnaudgiuliani
Copy link
Copy Markdown
Member Author

it's public, you can log in/ create an account

@volo-droid
Copy link
Copy Markdown

I'm logged in but I cannot access it. In the top right corner above the ticket title there's a visibility setting. What does it say? It should be either "Visible to issue readers", "All users" or "Registered users"

Screenshot 2025-11-05 at 14 53 04

@mityakoval
Copy link
Copy Markdown

mityakoval commented Dec 10, 2025

I'm confused. Does Koin have support for Ktor DI? @arnaudgiuliani

Both Koin docs and Ktor docs talk about great interoperability between the two starting with Koin 4.1+. But I was unable to make it work.
Koin doesn't seem to have access to Ktor-defiined deps to be able to inject them in the constructor.

@sroebert
Copy link
Copy Markdown

Yes, this is very confusing, after digging into the code I realized this functionality is currently commented out. Might be a good idea to at least update the Koin docs until this is fixed?

@arnaudgiuliani
Copy link
Copy Markdown
Member Author

It's on hold for now. We need Ktor 3.4 to achieve it.

@arnaudgiuliani arnaudgiuliani changed the title [Feat] Ktor DI 3.2 integration [Feat] Ktor DI integration Dec 22, 2025
@arnaudgiuliani arnaudgiuliani modified the milestones: 4.2.0, 4.3.0 Jan 15, 2026
# Conflicts:
#	examples/gradle/versions.gradle
#	projects/gradle.properties
@arnaudgiuliani
Copy link
Copy Markdown
Member Author

@lidonis Ktor DI could be finalized with ktor 3.4 🎉

@arnaudgiuliani arnaudgiuliani changed the title [Feat] Ktor DI integration [Feat] Ktor DI integration - Ktor 3.4 Jan 20, 2026
@arnaudgiuliani arnaudgiuliani merged commit 1706a83 into 4.2.0 Jan 20, 2026
3 of 4 checks passed
@arnaudgiuliani arnaudgiuliani modified the milestones: 4.3.0, 4.2.0 Jan 20, 2026
@arnaudgiuliani arnaudgiuliani removed the status:wait_feedback Need more details or follow-up label Jan 20, 2026
@arnaudgiuliani
Copy link
Copy Markdown
Member Author

Docs will be updated / Feature deployed in Koin 4.2.0 Beta4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kotlin-issue Related to Kotlin issue under the hood

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants