ecosyste-ms / packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.
https://packages.ecosyste.ms
GNU Affero General Public License v3.0
25 stars 4 forks source link

OpenAPI: Should `lookupPackage` contain a `registry` in the response? #642

Closed jamietanna closed 7 months ago

jamietanna commented 7 months ago

I noticed that https://packages.ecosyste.ms/api/v1/packages/lookup?purl=pkg:maven/org.springframework%3Aspring-jcl shows that there's:

    "registry": {
      "created_at": "2022-07-21T16:40:13.074Z",
      "default": true,
      "ecosystem": "maven",
      "github": "maven-central",
      "icon_url": "https://github.com/maven-central.png",
      "keywords_count": 31262,
      "maintainers_count": 0,
      "maintainers_url": "https://packages.ecosyste.ms/api/v1/registries/repo1.maven.org/maintainers",
      "metadata": {
        "funded_packages_count": 23151
      },
      "name": "repo1.maven.org",
      "namespaces_count": 66305,
      "namespaces_url": "https://packages.ecosyste.ms/api/v1/registries/repo1.maven.org/namespaces",
      "packages_count": 499500,
      "packages_url": "https://packages.ecosyste.ms/api/v1/registries/repo1.maven.org/packages",
      "updated_at": "2024-02-06T13:12:43.099Z",
      "url": "https://repo.maven.apache.org/maven2"
    },

Is this a required field, or is it optional? It doesn't appear to be in the OpenAPI spec for the lookupPackage operation:

https://github.com/ecosyste-ms/packages/blob/03a6672f9c78883786e44cdc8be28bfefbb46d2d/openapi/api/v1/openapi.yaml#L19-L70

(I'd be happy getting a PR raised!)

Upvote & Fund

Fund with Polar

andrew commented 7 months ago

It should be there, the documentation is wrong, we need something like '#/components/schemas/PackageWithRegistry' as the return result.