Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kingg22
Copy link
Contributor

@kingg22 kingg22 commented Jul 23, 2025

Hey, this is a preview to resolve #868 This is the cleanest version, but need to be tested when use inheritance, or other use cases.

Is very simple, add target function to @NoDelegation

interface TestService {
    @GET("/hello")
    suspend fun test(): String

    @GET("/hello/world") // is not necessary, but can have it
    @NoDelegation // without this is error
    fun test2(): String = runBlocking { test() }
}

Before this PR, ktorfit override all functions of the interface and/or throw error when don't have http annotations.

🤔 DOD Checklist

Need review, after that, can add to docs

  • I did all relevant changes to the documentation and the changelog.

@kingg22
Copy link
Contributor Author

kingg22 commented Jul 27, 2025

Hey @Foso, do you agree with this feature? Do you like this design? Is there anything we can improve? This is the most important change for my use case, to reduce boilerplate.

@kingg22 kingg22 force-pushed the feat/ignore-default-method branch from f608d85 to cbcab1b Compare July 29, 2025 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support NoDelegation on methods of an interface without NoDelegation

1 participant