Visitar URL original
JSON API exists for Snapshots but not for Packages · Issue #234 · commercialhaskell/stackage-server · GitHub
Skip to content

JSON API exists for Snapshots but not for Packages #234

Open

Description

@f-f

Calling http --json https://www.stackage.org/lts-9.0 gets us a nice json answer with the snapshot content:

{
    "packages": [
        {
            "isCore": false,
            "name": "abstract-deque",
            "synopsis": "Abstract, parameterized interface to mutable Deques.",
            "version": "0.3"
        },
        ...,
    ],
    "snapshot": {
        "created": "2017-07-26",
        "ghc": "8.0.2",
        "name": "lts-9.0"
    }
}

But querying a single package (e.g. http --json https://www.stackage.org/lts-9.0/package/base-4.9.1.0) returns instead just the html page for the package.

It would be very nice (and consistent) to have json responses also on package pages, to enable programmatic navigation of Stackage.

If this makes sense I'd be very happy to put together a PR.

Activity

  1. zudov commented on Aug 15, 2017

    @zudov
    Collaborator

    That would indeed be useful.

    The implementation should be pretty similar to what we had at #152, only applied to Handler.Package.packagePage.

  2. f-f commented on Aug 15, 2017

    @f-f
    Author

    Awesome thanks 👍
    I'll give this a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions