【问题标题】:Parsing error due to invalid body ASK CLI由于无效正文 ASK CLI 导致解析错误
【发布时间】:2021-06-11 17:34:00
【问题描述】:

使用 ASK CLI,我正在尝试更新我的智能家居技能清单,但我遇到了以下错误。

询问 smapi get-skill-manifest -s amzn1.ask.skill.6d0d22eb-d305-4caa-8921-503cb7827454 -p supreet > Skill-manifest.json

我刚刚更改了下载清单中的拼写。

询问 smapi update-skill-manifest -s --manifest $(cat Skill-manifest.json)

询问 smapi update-skill-manifest -s --manifest Skill-manifest.json

"response": {
      "message": "Request is not valid.",
      "violations": [
        {
          "code": "INVALID_REQUEST_PARAMETER",
          "message": "Parsing error due to invalid body.",
          "validationDetails": {
            "originalInstance": {
              "type": "BODY"
            },
            "reason": {
              "type": "MALFORMED_INPUT"
            }
          }
        }
      ]
    }

这是技能清单.json

{
  "manifest": {
    "apis": {
      "smartHome": {
        "endpoint": {
          "uri": "<arn>"
        },
        "protocolVersion": "3"
      }
    },
    "manifestVersion": "1.0",
    "permissions": [
      {
        "name": "alexa::async_event:write"
      }
    ],
    "privacyAndCompliance": {
      "allowsPurchases": false,
      "containsAds": false,
      "isChildDirected": false,
      "isExportCompliant": true,
      "locales": {
        "en-IN": {
          "privacyPolicyUrl": "https://www.privacyyyyyyypolicy.net",
          "termsOfUseUrl": "https://www.termsofuse.net"
        }
      },
      "usesPersonalInfo": false
    },
    "publishingInformation": {
      "automaticDistribution": {
        "isActive": false
      },
      "category": "SMART_HOME",
      "distributionCountries": [],
      "distributionMode": "PUBLIC",
      "isAvailableWorldwide": true,
      "locales": {
        "en-IN": {
          "description": "Test",
          "examplePhrases": [
            "test"
          ],
          "keywords": [
            "test"
          ],
          "largeIconUri": "<logo-url>",
          "name": "Test",
          "smallIconUri": "<logo2-url>",
          "summary": "Test"
        }
      },
      "testingInstructions": "test using alexa"
    }
  }
}

【问题讨论】:

    标签: alexa alexa-skills-kit alexa-voice-service smarthomeskill ask-cli


    【解决方案1】:

    几个月前,我在上传清单时遇到了同样的问题。 问题是 json 文件必须以前缀“file:”开头,例如:

    --manifest "file:manifestFile.json"
    

    所以你的命令是:

    ask smapi update-skill-manifest -s --manifest "file:skill-manifest.json"
    

    Here 是关于此的更多详细信息。

    【讨论】:

      【解决方案2】:

      检查 Skill-manifest.json 文件的编码!

      当使用 ask cli 下载文件时,它在我的情况下设置了 UTF-16 LE,由于某种原因在更新时不接受它。 将编码更改为UTF-8ISO 8859-1 后,它起作用了。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-03-20
        • 1970-01-01
        相关资源
        最近更新 更多