Get Packages Related to a File
GET/code/api/v1/vulnerabilities/packages/files/:fileMetadataId
Gets all the Packages related to a specific file based on pagination Pagination is required - this endpoint must use the pagination.validate The API accepts a file metadata UUID. There is an option to get the packages sorted by their error count. root-only query parameter is optional - if true, returns only root level packages, in a sense of the file's dependency tree
Request
Path Parameters
fileMetadataId stringrequired
Query Parameters
limit doublerequired
offset doublerequired
sort string
Possible values: [errors
]
root-only boolean
Responses
- 200
- 422
get packages by file
- application/json
- Schema
- Example (from schema)
- Example 1
Schema
- Array [
- Array [
- ]
- Array [
- ]
- ]
fileMetadataId stringrequired
hasNext booleanrequired
packages object[]required
errorCount double
fileMetadataId string
fileMetadataPath string
fixableErrorCount double
images string[]
isRoot boolean
licensesMetadata object[]
isOsi booleanrequired
isSpdx booleanrequired
license stringrequired
packageId stringrequired
packageLanguage string
packageLicenses string[]required
packageName stringrequired
packageVersion stringrequired
repository object
name string
owner string
sourcePackageIds object[]nullable
sourcePackageId stringrequired
{
"fileMetadataId": "string",
"hasNext": true,
"packages": [
{
"errorCount": 0,
"fileMetadataId": "string",
"fileMetadataPath": "string",
"fixableErrorCount": 0,
"images": [
"string"
],
"isRoot": true,
"licensesMetadata": [
{
"isOsi": true,
"isSpdx": true,
"license": "string"
}
],
"packageId": "string",
"packageLanguage": "string",
"packageLicenses": [
"string"
],
"packageName": "string",
"packageVersion": "string",
"repository": {
"name": "string",
"owner": "string"
},
"sourcePackageIds": [
{
"sourcePackageId": "string"
}
]
}
]
}
{
"fileMetadataId": "b3f4f652-b71a-4b8b-8b7f-f812f80a7b44",
"hasNext": false,
"packages": [
{
"fileMetadataId": "8d79e5a6-399b-42c3-8678-1fc165ca72c5",
"packageId": "b3f4f652-b71a-4b8b-8b7f-jd2k359k5d36",
"packageLicenses": [],
"packageName": "express",
"packageVersion": "4.17.1"
}
]
}
Request arguments validation error
Loading...