[英]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"
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-8
或ISO 8859-1
后,它就可以工作了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.