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

Add 'licence' field to /api/packages/<package> endpoint #7475

Open
delliot opened this issue Feb 9, 2024 · 3 comments
Open

Add 'licence' field to /api/packages/<package> endpoint #7475

delliot opened this issue Feb 9, 2024 · 3 comments

Comments

@delliot
Copy link

delliot commented Feb 9, 2024

I have a usecase where I need to cache licenses for Pub packages. It's currently possible to download each version archive tarball and examine the license file, but it would save downloading tarballs if you were able to add a 'license' field to either the top level package object, or to each version object as returned by the /api/packages/<package> endpoint.

It is currently possible to get the rest of this metadata (if available) from the pubspec field, but the license data is only possible by parsing the HTML or tarball.

image

// Current object:

{
        "version": "",
        "pubspec": {},
        "license": "MIT" // Suggested new field
        "archive_url": "",
        "archive_sha256": "",
        "published": ""
},
@sigurdm
Copy link
Contributor

sigurdm commented Feb 12, 2024

I don't think we'll extend the version listing api with this information.

The only official apis we support are documented on: https://pub.dev/help/api

There is the unofficial https://pub.dev/api/packages/<package>/score it contains the derived license.

Don't build a big pipeline on it, as we might change it in the future without warning.

@isoos
Copy link
Collaborator

isoos commented Feb 12, 2024

I have a usecase where I need to cache licenses for Pub packages.

Could you please share more about the use-case and how we may serve it better?

There is the unofficial https://pub.dev/api/packages//score it contains the derived license.

Please take this seriously. We don't support APIs outside of the ones on the linked help page.

@jonjanego
Copy link

👋 from the GitHub dependency graph team. We'd also love to have this data in the API, as it would help us report on license information in Dart packages. Currently we don't have it since there isn't an authoritative API to source this data from, limiting Dart from being able to use features like dependency review. We'd love to offer this to our many shared users.

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

No branches or pull requests

4 participants