首页 > 解决方案 > 如何解决“无效类型。需要整数但得到数字。” 用于 Power Automate 中的 JSON 有效负载?

问题描述

我在使用Parse JSONPower Automate 流中的函数的示例 JSON 有效负载中遇到错误:

{
    "message": "Invalid type. Expected Integer but got Number.",
    "lineNumber": 0,
    "linePosition": 0,
    "path": "issues[0].fields.customfield_18478",
    "value": 1,
    "schemaId": "#/properties/issues/items/properties/fields/properties/customfield_18478",
    "errorType": "type",
    "childErrors": []
}

以上是我在 JIRA 中的自定义字段中遇到的示例错误。任何线索如何解决它?

标签: jsonapipower-automate

解决方案


看起来您必须为integer和定义架构number。这应该可以解决问题。

"customfield_18478": {

"type": ["integer", "number"]

},

参考


推荐阅读