ecosyste-ms/packages

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

jamietanna opened this issue · 1 comments

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:

/packages/lookup:
get:
summary: lookup a package by repository URL, purl or ecosystem and name
operationId: lookupPackage
tags:
- packages
parameters:
- name: repository_url
in: query
description: repository URL
required: false
schema:
type: string
- name: purl
in: query
description: package URL
required: false
schema:
type: string
- name: ecosystem
in: query
description: ecosystem name
required: false
schema:
type: string
- name: name
in: query
description: package name
required: false
schema:
type: string
- name: sort
in: query
description: field to sort results by
required: false
schema:
type: string
- name: order
in: query
description: direction to sort results by
required: false
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Package'

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

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
andrew commented

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