Vinicius Carvalho
07/10/2018, 4:53 PMval mapper: ObjectMapper by kodein.instance<ObjectMapper>()
val function = System.getenv("FUNCTION_NAME")
val fn = kodein.direct.allInstances<Any>(tag = function)[0]
val arg = mapper.readValue<Any>(input, mapper.typeFactory.constructType(fn::class.declaredFunctions.first().parameters[1].type.javaType))
val fx = fn as Function1<Any, *>
mapper.writeValue(output, fx(arg))