After talking to the hub team, it appears that assuming PolicyRule.Expression.ExpressionParameter.Data to be a map[string]IntOrString type was incorrect.
PolicyRule.Expression.ExpressionParameter.Data is a dynamic JSON object whose contents are dependent on the details of the policy. Changing the type to be a map[string]interface{} should fix this issue.
Also PolicyRule.Expression.ExpressionParameter.Data is not mentioned in the hub api docs. There's a separate bug tracking this.
Handle cases where 'data' is not a string or integer type while consuming policy-rules of a BOM component API
Addresses https://github.com/blackducksoftware/hub-client-go/issues/55
After talking to the hub team, it appears that assuming
PolicyRule.Expression.ExpressionParameter.Data
to be amap[string]IntOrString
type was incorrect.PolicyRule.Expression.ExpressionParameter.Data
is a dynamic JSON object whose contents are dependent on the details of the policy. Changing the type to be a map[string]interface{} should fix this issue.Also
PolicyRule.Expression.ExpressionParameter.Data
is not mentioned in the hub api docs. There's a separate bug tracking this.