gomods/athens

[Proposal] Improve the catalog endpoint format

Offen

#1.186 geöffnet am 13.04.2019

 (22 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Go (538 Forks)github user discovery
enhancementgood first issue

Repository-Metriken

Stars
 (4.766 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 18T 13h) (13 gemergte PRs in 30 T)

Beschreibung

Is your feature request related to a problem? Please describe.

Right now, utilities that want to use the /catalog endpoint often need to aggregate each module's versions into a list. For example, the /catalog endpoint returns this:

{
    "modules": [
        {
            "module":"github.com/arschles/assert",
            "version": "v1.0.0"
        },
        {
            "module": "github.com/arschles/assert",
            "version": "v1.1.0"
        }
    ]
}

Many programs will find it more convenient to get a response similar to this:

{
    "modules": {
        "github.com/arschles/assert": ["v1.0.0", "v1.1.0"]
    }
}

Describe the solution you'd like

I'd like us to add a V2 of the catalog API that responds this way. This could possibly be exposed as a /catalog/v2 endpoint.

Describe alternatives you've considered

Clients can always aggregate in their own code

Additional context

  • There will be non-trivial work on the storage systems to achieve this
  • There are two projects I know of that could benefit from this change:

cc/ @marwan-at-work

Contributor Guide