In xml, an attribute is allowed to be duplicated, thus making it a list. The code in here incorrectly defines this and fails to parse this xml.
Here is one example:
<xs:attribute name="SupportedEAPMethods" type="tt:IntList">
<xs:annotation>
<xs:documentation>EAP Methods supported by the device. The int values refer to the <a href="http://www.iana.org/assignments/eap-numbers/eap-numbers.xhtml">IANA EAP Registry</a>.</xs:documentation>
</xs:annotation>
</xs:attribute>
Notice the SupportedEAPMethods="0". So the result should be [0], an array containing 1 item, the value 0.
However, parsing fails:
level=ERROR ts=2023-02-24T01:09:51.624822237Z app=device-onvif-camera source=restrouter.go:168 X-Correlation-ID=6d23a4fc-31f4-4795-9ce0-1532f35c8e5b msg="error reading DeviceResourece DeviceCapabilities for HIKVISION-DS-2DE2A404IW-DE3-099f4000-4d50-11b4-82c8-c06ded544d67 -> failed to execute read command -> failed to create 'GetServiceCapabilities' response for the web service 'Device' -> cannot unmarshal into device.EAPMethodTypes"
In xml, an attribute is allowed to be duplicated, thus making it a list. The code in here incorrectly defines this and fails to parse this xml.
Here is one example:
Notice the
SupportedEAPMethods="0"
. So the result should be[0]
, an array containing 1 item, the value 0.However, parsing fails: