简体   繁体   English

由于无效正文 ASK CLI 导致解析错误

[英]Parsing error due to invalid body ASK CLI

Using ASK CLI, I'm trying to update my smart home skill manifest but I'm facing the below error.使用 ASK CLI,我正在尝试更新我的智能家居技能清单,但我面临以下错误。

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

I have just changed a spelling in the downloaded manifest.我刚刚更改了下载清单中的拼写。

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

OR或者

ask smapi update-skill-manifest -s --manifest 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"
            }
          }
        }
      ]
    }

Here's the skill-manifest.json这是技能清单。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"
    }
  }
}

I ran into the same issue few months ago while uploading a manifest.几个月前,我在上传清单时遇到了同样的问题。 The issue was that the json file had to be preceded by the prefix "file:" like:问题是 json 文件必须以前缀“file:”开头,例如:

--manifest "file:manifestFile.json"

And so your command would be:所以你的命令是:

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

Here are more details about this. 以下是有关此的更多详细信息。

Check the encoding of the skill-manifest.json file!检查skill-manifest.json文件的编码!

When downloading the file with the ask cli it had UTF-16 LE set in my case, which is not accepted when updating for some reason.当使用 ask cli 下载文件时,它在我的情况下设置了UTF-16 LE ,由于某种原因在更新时不被接受。 After changing the encoding to either UTF-8 or ISO 8859-1 it worked.将编码更改为UTF-8ISO 8859-1后,它就可以工作了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 成功(?)安装ask-cli后,出现提示无效json的部署错误。 我该如何解决? - After successful(?) installation of ask-cli, I'm getting a deployment error where it says invalid json. How do I fix this? ask-cli、Ask deploy、UnrecognizedClientException:请求中包含的安全令牌无效 - ask-cli, Ask deploy, UnrecognizedClientException: The security token included in the request is invalid 询问部署错误:无效的URL信息 - ASK Deploy Error: Invalid URL Info 问 CLI:模拟不解析技能,返回 IntentForDifferentSkill 错误 - Ask CLI: Simulate not resolving skill, returning IntentForDifferentSkill error 安装 ASK-CLI 后如何修复“bash: ask: command not found”错误? - How to fix 'bash: ask: command not found' error after installing the ASK-CLI? 询问CLI INIT不起作用 - ASK CLI INIT not working 每次我在 ask-cli v2 中部署我的技能时都会抛出错误 - Error keeps throwing everytime i deploy my skill in ask-cli v2 ask-smapi-sdk 身份验证失败 error_description:'客户端身份验证失败',错误:'invalid_client' - ask-smapi-sdk Authentication Failed error_description: 'Client authentication failed', error: 'invalid_client' 问cli init产生TypeError - ask cli init is generating a TypeError 是否要求将CLI部署到不同的环境? - ASK CLI to deploy to different environments?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM