analytics-apim
analytics-apim copied to clipboard
Incorrect use of props validation
Description:
https://github.com/wso2/analytics-apim/blob/master/components/org.wso2.analytics.apim.widgets/APIMTopFaultyApis/src/APIMTopFaultyApis.jsx#L264
(there are multiple instances like this)
faultData
is actually an array but it is validated as an Object. So this could become null
without failing props validation.
Solution :
- Change this to Array in validation and use defaultprops.
Related to https://github.com/wso2/analytics-apim/pull/1087
Suggested Labels:
Suggested Assignees:
Affected Product Version:
OS, DB, other environment details and versions:
Steps to reproduce:
Related Issues:
Since we can't assume a default value for the data, can't we skip the default values and only correct the prop-types?