从AWS Lambda API调用提取路径

时间:2019-02-20 00:35:10

标签: scala amazon-web-services aws-lambda aws-api-gateway aws-java-sdk

我的Lambda处理程序如下所示:

override def handleRequest(inputStream: InputStream, outputStream: OutputStream, context: Context): Unit = {

val mapper = new ObjectMapper() with ScalaObjectMapper
      mapper.registerModule(DefaultScalaModule)
      val mapped = mapper.readValue(inputStream, classOf[RequestSchema])
      println("Path: \n")
      println(mapped.path)
      inputStream.close()
}

case class RequestSchema(path: String)

path在即将到来的请求的有效负载中。但是,当我将其打印出来时,我得到的是null。知道如何提取path字段吗?

0 个答案:

没有答案