Azure / Azure/azure-iot-cli-extension
[bug] az iot product test does not validate command responses with Map
- Dominant language
- Python
- Stars
- 88
- Forks
- 78
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 9
Description
I'm validating a PnP device using a command with the next response
```JSON
"response": {
"@type": "CommandPayload",
"name": "diagnosticResults",
"schema": {
"@type": "Map",
"mapKey": {
"name": "key",
"schema": "string"
},
"mapValue": {
"name": "val",
"schema": "string"
}
}
}
```
The device returns a proper JSON object,
When running the `az iot product test` I got
```
"message": "{\"commandName\":\"getRuntimeStats\",\"expectedSchemaType\":\"Map\",\"actualSchemaType\":\"Unknown\",\"message\":\"Inconsistent value type. Expected type: [String], actual type: [JObject], Error code:1004, Error code:1024\",\"passed\":false,\"time\":\"2022-01-27T19:18:30.5515017+00:00\"}",
"time": "2022-01-27T19:18:30.5515017+00:00"
},
{
"message": "PnP interface commands validation failed",
"time": "2022-01-27T19:18:30.5519899+00:00"
}
```
Contributor guide
Research direction
Start by reproducing the failure with `az iot product test` using a PnP command response whose schema type is `Map` and whose device response is a JSON object. Trace the command-response validation path and compare Map handling with the reported String-versus-JObject error. Done means valid Map responses pass validation without the PnP interface command validation failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, python
- Domain
- cli, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100