Closed akashnagesh closed 4 years ago
There is definitely needs to be more info - versions of hub, APIs, maybe an example of json
Tested this against hub 2020.1 and 2020.4. It was reproducible on both these versions.
API version used was V6.
After talking to folks from the hub team, it appears that the hub-client was incorrect to assume the data type of PolicyRule.Expression.ExpressionParameter.Data
to be a map[string]IntOrString
Also, there is no mention of PolicyRule.Expression.ExpressionParameter.Data
in hub api docs at all. There's a different bug tracking this issue.
Failing to consume the response for
/api/projects/{projectId}/versions/{projectVersionId}/components/{componentId}/versions/{componentVersionId}/policy-rules
This is because
PolicyRule.Expression.ExpressionParameter.Data
was expected to be anmap[string]IntOrString
type. But this doesn't seem to be always true.A sample response where this fails:
Here "data" is a boolean because of which we will fail to unmarshal this response.
Changing the
PolicyRule.Expression.ExpressionParameter.Data
type to be amap[string]interface{}
would perhaps fix this issue.