analytics-apim icon indicating copy to clipboard operation
analytics-apim copied to clipboard

Incorrect use of props validation

Open pahans opened this issue 4 years ago • 1 comments

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 :

  1. 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:

pahans avatar Mar 22 '20 13:03 pahans

Since we can't assume a default value for the data, can't we skip the default values and only correct the prop-types?

Ketharan avatar May 29 '20 10:05 Ketharan