Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON API exists for Snapshots but not for Packages #234

Open
f-f opened this issue Aug 15, 2017 · 2 comments
Open

JSON API exists for Snapshots but not for Packages #234

f-f opened this issue Aug 15, 2017 · 2 comments

Comments

@f-f
Copy link

f-f commented Aug 15, 2017

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.

@zudov
Copy link
Collaborator

zudov commented Aug 15, 2017

That would indeed be useful.

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

@f-f
Copy link
Author

f-f commented Aug 15, 2017

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants