AWS API 网关模型:指定的模型架构无效

AWS API Gateway Model : Invalid model schema specified

我在 aws api 网关中创建模型时遇到错误,Json 格式正确,但它仍然显示验证错误。请问有人吗?我哪里出错了?

错误信息"Invalid model specified: Validation Result: warnings : [], errors : [Invalid model schema specified]"

Json 我尝试使用的架构是:

{
   "action":"createOrUpdate",
   "Content-Type":"application/json",
   "accept":"application/json",
   "input":[
      {
         "utm_CustomObj":"19UYA31581L000000",
         "leadId":"1071319"
      }
   ]
}

Error screen shot

您似乎并没有真正为您的数据定义架构。有关使用 JSON 架构定义模型的一些示例,请参阅 the API gateway documentation

它可能应该遵循 Open API json 格式,例如 Api 网关“错误”模型。

错误模型

{
   "$schema":"http://json-schema.org/draft-04/schema#",
   "title":"Error Schema",
   "type":"object",
   "properties":{
      "message":{
         "type":"string"
      }
   }
}

了解更多信息:Swagger Docs

Apache Velocity Template Language 是模型的语言。如果您正在创建模型,这是您正在使用的语言,而不是 JSON .