sonatype / ossindex-public

Sonatype OSS Index - Public
Apache License 2.0
6 stars 9 forks source link

Update API so that encoded characters in path parameters are allowed #14

Closed ndonewar closed 4 years ago

ndonewar commented 4 years ago

This change addresses an issue where links to scoped npm packages resulted in 404s in the OSS Index service. Namespaces in npm include an @ symbol. According to purl-spec, that should be encoded as %40. However, the path param was being decoded into the @ symbol, resulting in an invalid PackageUrl. Generally, most parts of purls use percent-encoded strings when necessary.

The JAX-RS javadocs state that the @Encoded attribute "disables automatic decoding of parameter values...". By disabling decoding, the coordinates path param can be read as intended.

Additionally, hide GET in the Swagger docs until an issue with the construction of encoded path params is resolved (separate issue open).

Internal references: OSSI-327, OSSI-336, and testsuite