Closed
Description
This endpoint returns a 200 status code on error.
For example: /api/collect/?purl=pkg:npm/foo@1.0
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept
{
"status": "error(s) occurred when fetching metadata for pkg:npm/foo@1.0: Package does not exist on npmjs: pkg:npm/foo@1.0"
}
We should have an appropriate status code to make things easier on the consumer side.
By the way, calling /api/collect/
with a purl return a proper 400 status code:
HTTP 400 Bad Request
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept
{
"errors": {
"purl": [
"This field is required."
]
}
}