IOTechSystems / onvif

full and enhanced onvif protocol stack in golang.
MIT License
17 stars 12 forks source link

GetCapabilities.Category should be an array #20

Closed ajcasagrande closed 1 year ago

ajcasagrande commented 1 year ago

If you check the specs, the field is unbounded, ie. an array: https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl#op.GetCapabilities

Payload:

{
  "Category": ["All"]
}

Command:

curl --location --request GET 'http://localhost:59882/api/v2/device/name/tp-link-Tapo-C200-3fa1fe68-b915-4053-a3e1-1027f5ea88f4/Capabilities?jsonObject=ewogICJDYXRlZ29yeSI6IFsiQWxsIl0KfQ=='

Response:

{
    "apiVersion": "v2",
    "message":"request failed, status code: 500, err: {\"apiVersion\":\"v2\",\"message\":\"error reading DeviceResourece Capabilities for tp-link-Tapo-C200-3fa1fe68-b915-4053-a3e1-1027f5ea88f4 -\> failed to execute read command -\> failed to create 'GetCapabilities' request for the web service 'Device' -\> json: cannot unmarshal array into Go struct field GetCapabilities.Category of type onvif.CapabilityCategory\",\"statusCode\":500}",
    "statusCode": 500
}