According to NPM type spec, the @ used for the scope is supposed to be encoded, however, there are 2 tests expected to pass that actually pass the @ unencoded:
|
{ |
|
"description": "valid npm purl without version and with subpath, scope unencoded", |
|
"test_group": "advanced", |
|
"test_type": "roundtrip", |
|
"input": "pkg:npm/@babel/core#/googleapis/api/annotations/", |
|
"expected_output": "pkg:npm/%40babel/core#googleapis/api/annotations", |
|
"expected_failure": false, |
|
"expected_failure_reason": null |
|
}, |
|
{ |
|
"description": "valid npm purl without version and with subpath, scope unencoded", |
|
"test_group": "advanced", |
|
"test_type": "parse", |
|
"input": "pkg:npm/@babel/core#/googleapis/api/annotations/", |
|
"expected_output": { |
|
"type": "npm", |
|
"namespace": "@babel", |
|
"name": "core", |
|
"version": null, |
|
"qualifiers": null, |
|
"subpath": "googleapis/api/annotations" |
|
}, |
|
"expected_failure": false, |
|
"expected_failure_reason": null |
|
}, |
Even the npm type spec mentions they are supposed to be percent encoded :
|
"note": "The namespace is used for the scope of a scoped NPM package. The npm scope @ sign prefix is always percent encoded, as it was in the early days of npm scope." |
Is it expected and something is missing from the parsing spec or are those tests really invalid and should be either removed or modified to become valid ?
According to NPM type spec, the @ used for the scope is supposed to be encoded, however, there are 2 tests expected to pass that actually pass the @ unencoded:
purl-spec/tests/types/npm-test.json
Lines 181 to 205 in 1f8c6f2
Even the npm type spec mentions they are supposed to be percent encoded :
purl-spec/types/npm-definition.json
Line 16 in 1f8c6f2
Is it expected and something is missing from the parsing spec or are those tests really invalid and should be either removed or modified to become valid ?