关于APIGatewayCustomAuthorizerContextOutput仅支持字符串值的疑问
我们在开发C# Lambda授权器时,会返回APIGatewayCustomAuthorizerResponse对象,其中的Context属性类型为APIGatewayCustomAuthorizerContextOutput,我们原本打算通过这个属性给授权器前置的“API Lambda”传递上下文数据。
但实际使用时遇到了问题:虽然APIGatewayCustomAuthorizerContextOutput继承了Dictionary<String, Object>,但我们根本不能往里面存放Object类型的值——这个字典只能接受字符串类型的内容。
我在API Gateway的CloudWatch日志里看到了如下错误:
Execution failed due to configuration error: Invalid JSON in response: Cannot deserialize value of type
java.lang.Stringfrom Object value (tokenJsonToken.START_OBJECT)
我现在特别疑惑:既然不允许使用真正的Object值,那APIGatewayCustomAuthorizerContextOutput为什么要继承Dictionary<String, Object>呢?
备注:内容来源于stack exchange,提问作者Tom Baxter
相关产品推荐
相关产品推荐

