You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Power Automate脚本JSON Schema验证报错:预期Integer却获Number类型

Power Automate JSON Schema验证错误解决

错误原因

你遇到的Invalid type. Expected Integer but got a Number和ValidationFailed错误,核心是类型不匹配:

  • 你的JSON Schema定义complexity字段类型为Integer(仅接受整数)
  • 实际传入的"complexity":0.4是浮点数,属于JSON的Number类型,不符合Schema要求

解决方法

根据业务需求二选一:

  1. 调整输入值为整数
    如果业务逻辑要求complexity必须是整数,把输入的浮点数转为整数(比如四舍五入、取整),示例:

    "complexity": 0
    

    或者

    "complexity": 1
    
  2. 修改JSON Schema允许浮点数
    如果业务允许complexity使用小数,把Schema里的Integer类型改为Number,示例:

    "complexity": { "type": "Number" }
    

内容的提问来源于stack exchange,提问作者cmaer1

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.22 17:12:00