client-go
client-go copied to clipboard
dtrack.Component's structure is different the output of GET /api/v1/component/project/{uuid}
ComponentService.GetAll() returns (p Page[Component], err error). The structure of client-go's dtrack.Component is not the same as what the API server returns (although it matches the API server OpenAPI spec.)
The API server returns, for example, the following component keys, as verified by curl -v -H "X-API-Key: $DT_API_KEY" -H "Accept: application/json" localhost:8080/api/v1/component/project/ca1a176a-97ec-4c51-af27-c6c156bd5b82 | jq ".[0] | keys":
classifier, expandDependencyGraph, isInternal, lastInheritedRiskScore, metrics, name, project, purl, purlCoordinates, repositoryMeta, usedBy, uuid, version
The OpenAPI spec and dtrack.Component references many fields I have not seen returned by /api/v1/component/project/{uuid}, such as SHAs.
I mention this because I'd really like access to repositoryMeta.published, which is returned, but not in a documented way.