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

API docs missing githubRepository entry #267

Closed
hasundue opened this issue Mar 12, 2024 · 6 comments · Fixed by #277
Closed

API docs missing githubRepository entry #267

hasundue opened this issue Mar 12, 2024 · 6 comments · Fixed by #277
Labels
bug Something isn't working documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@hasundue
Copy link

hasundue commented Mar 12, 2024

Recently I have implemented a basic support for JSR in my dependency updater.
I'm thinking of adding a feature to show "what's changed" commit logs next, but find it tricky because the package details endpoint of the JSR API does not contain information on the original repository of source code, while the front-end has a link to a repository if available.

I respect that JSR doesn't even require a package to be hosted online or managed with git, but it might be cool to have such a field in the endpoint in some use cases.

@lucacasonato
Copy link
Member

The package endpoint does have both repository and name: https://api.jsr.io/scopes/std/packages/fs

{
  "scope": "std",
  "name": "fs",
  "description": "Helpers for working with the file system",
  "githubRepository": {
    "id": 156498505,
+   "owner": "denoland",
+   "name": "deno_std",
    "updatedAt": "2023-12-22T11:10:57.995437Z",
    "createdAt": "2023-12-22T11:10:57.995437Z"
  },
  "runtimeCompat": {
    "browser": false,
    "deno": true,
    "node": false,
    "workerd": false
  },
  "updatedAt": "2024-02-26T07:58:50.302101Z",
  "createdAt": "2023-12-22T03:19:20.157401Z",
  "versionCount": 12,
  "score": 88,
  "latestVersion": "0.219.1",
  "whenFeatured": null
}

You can find the docs for the API here: https://jsr.io/docs/api#management-api

@hasundue
Copy link
Author

Oh yeah it does. I just read https://jsr.redoc.ly/#operation/getPackage but didn't look at an actual response. Thanks.

@lucacasonato
Copy link
Member

Oops - looks like a bug in the API docs 😓

@lucacasonato lucacasonato added bug Something isn't working documentation Improvements or additions to documentation and removed question labels Mar 12, 2024
@lucacasonato lucacasonato changed the title API: Add a repository URL in the package details endpoint API docs missing githubRepository entry Mar 12, 2024
@hasundue
Copy link
Author

Glad to know that this issue was totally not in vain😁

@lucacasonato
Copy link
Member

If anyone wants to fix this, the API defintion is in https://github.com/jsr-io/jsr/blob/main/api/src/api.yml. You can add the relevant changes to the OpenAPI document there. When you open a PR, there will be a link from "Redocly" in the status section that you can use to preview the output.

@lucacasonato lucacasonato added the good first issue Good for newcomers label Mar 12, 2024
@Jayanth-Parthsarathy
Copy link
Contributor

I would love to work on this. Please assign this to me @lucacasonato

github-merge-queue bot pushed a commit that referenced this issue Mar 14, 2024
# Add Github Repository property to Packages
Fixes #267 

- [x] Added Github Repository property to Package and made it optional
- [x] Checked locally with `@redocly/cli`

## Screenshot


![image](https://github.com/jsr-io/jsr/assets/86654557/1055a906-99ff-4bbd-842b-de3d51de68c5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants