Fix compiled scripts demo from README
Compiled functions always show up with no metadata, and you can only guess what the types are from the bean definition. Probably we should add more information to the bean definition if we have it when we compile the function. There is still a problem if user defines functions that are not of Flux<String> (but that has always been the case).
This commit is contained in:
@@ -35,6 +35,7 @@ import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.ListableBeanFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
@@ -422,7 +423,10 @@ public class ContextFunctionCatalogAutoConfiguration {
|
||||
param = resolvable.getGeneric(index).getGeneric(0).getType();
|
||||
}
|
||||
else {
|
||||
// TODO: compiled functions only work as String -> String
|
||||
// TODO: compiled functions (only work as String -> String)
|
||||
if (paramType.isWrapper()) {
|
||||
return Flux.class;
|
||||
}
|
||||
return String.class;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user