-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Kotlin functions #1666
base: main
Are you sure you want to change the base?
Conversation
5f1b4c0
to
5abe465
Compare
e48ba68
to
ca53b46
Compare
@markpollack Forced-pushed to remove a |
merged in 9cf6633 |
Reopening the PR after finding a regression and reverting related commit from |
This commit adds support for proper Kotlin functions handling by adapting kotlin.jvm.functions.Function1 to java.util.function.Function and kotlin.jvm.functions.Function2 to java.util.function.BiFunction. It also removes the dependency on Spring Cloud Function and net.jodah:typetools which are replaced by leveraging Spring Framework ResolvableType capabilities.
This commit adds a Kotlin extension function for FunctionCallbackWrapper.Builder.withInputType allowing to specify withInputType<T>() instead of withInputType(T::class.java).
ca53b46
to
37829dd
Compare
I spent some time debugging the initial version of this PR that we had to revert after a regression detailed in #1685 and reproducible with @ThomasVitale repro. The reason why our tests did not catch this regression is not straightforward. In our tests, Generally speaking, I have added related tests using tests that involve scanning to trigger the ASM code path. Both tests and @ThomasVitale repro are green with that new version I forced pushed, and Open AI IT tests seems to be fine as well. There still may be some small differences with original SCF algorithm, but I guess we could refine with proper test if something is not supported yet. |
This PR adds:
FunctionCallbackWrapper.Builder
It also removes the dependency on Spring Cloud Function and
net.jodah:typetools
which are replaced by leveragingSpring Framework
RootBeanDefinition
andResolvableType
capabilities.