json - AWS 网关 - 由于负载(“方法执行”)与所需资源模型结果之间未对齐而导致的 500 错误
问题描述
我们正在为我们的 AWS Gateway API 构建最终资源树,该资源树由 4 个不同的 JSON 模型组成,每个模型都是前一个模型的子集。这里的目标是将它们全部整合到一个 JSON 有效负载中并成功执行它们。
问题是知道最终的 JSON 会是什么样子——我们很接近,但并不完全确定。当我们通过“方法执行”去执行时,我们得到一个 500(对于失败的转换)。因此,再次强调,目标是了解最终的 JSON 转换应该是什么样子。
第一个对象:
"type" : "object",
"properties" : {
"identifier" : {
"type" : "string",
"description" : "unique Identifier"
},
"templateData" : {
"$ref":"~path~/models/beneObjectTemplateData"
}
}
}
第二个对象是“beneObjectTemplateData”的子集:
"properties" : {
"beneData" : {
"$ref":"~path~/models/beneData"
}
},
"description" : "Beneficiary specific data"
}
第三个对象是“beneData”的一个子集:
"type" : "object",
"properties" : {
"beneSpecific" : {
"$ref":"~path~/models/beneSpecific"
}
},
"description" : "Beneficiary data"
}
最后一个对象是“beneSpecific”的子集:
{
"type" : "object",
"properties" : {
"name" : {
"type" : "string"
},
"classification" : {
"type" : "string",
"description" : "Type of beneficiary",
"pattern" : "^(Business|Individual)$"
},
"accountNumber" : {
"type" : "string",
"description" : "Required for Wires"
},
"localAccountNumber" : {
"type" : "string",
"description" : "Required for iACH"
}
}
}
这是我们为最终转换所写的内容,但它不起作用:
"properties": {
"identifier": "timetrail",
"templateData": {
"beneData": {
"beneSpecific": {
"name": "john",
"classification": "Individual",
"accountnumber": "3243244",
"localAccountNumber": ""
}
}
}
}
}
所以,我们想知道这里出了什么问题。
解决方案
推荐阅读
- flutter - 分配给 IconButton (onPressed) 的方法在状态初始化时自动调用
- sql-server - tds_fdw PostgreSQL 外部表将大文本截断为 2048 个字符
- python - 在 python:3.7 容器上运行 Selenium
- python - 在 Keras 层中使用自定义操作并使张量可训练
- pandas - Bigquery 函数中是否有等效的 pandas split(expand=True) ?
- c++ - 如何调整在其他屏幕分辨率上显示的 QLabel 文本的大小
- android - Google Oauth 同意屏幕仅显示进度条
- c++ - 返回语句在带有 postgres 数据库的 QT QSqlQuery 中不起作用
- c# - 覆盖 odata 错误响应,因此堆栈跟踪被隐藏
- javascript - 为输入id生成uuid