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

Get list of organization repositories #202

Open
tbrand opened this issue Sep 19, 2017 · 3 comments
Open

Get list of organization repositories #202

tbrand opened this issue Sep 19, 2017 · 3 comments

Comments

@tbrand
Copy link

tbrand commented Sep 19, 2017

Hi there!

I got an error when I try to get a list of repositories belong to an organization.
The code is like

const repos = await octokat.orgs(ORG_NAME).repos.fetchAll();

I got a correct result, however, octokat.js prints out a validation error.

Octokat BUG: Invalid Path. If this is actually a valid path then please update the URL_VALIDATOR. path=https://.../api/v3/organizations/.../repos?page=2

Could you fix this?
Thanks!

@mokkabonna
Copy link
Contributor

mokkabonna commented Dec 14, 2017

I have the same issue, this is because for the calls after the first, the url for the next page returned from github is:

https://github.example.com/api/v3/organizations/49/repos?page=2

So that is organizations instead of orgs, which the first page uses. The first call does not fail the url validation.

The same url pattern need to be repeated for organizations url, the same as for orgs url

| orgs/ [^/]+
| orgs/ [^/]+ / (
repos
| issues
| members
| events
| teams
| projects
)

@artdevgame
Copy link

@mokkabonna I'm hitting this same problem but unsure how to apply your suggested solution. Is there any chance you can raise a PR with the change in?

@davewongillies
Copy link

Was this ever fixed? I'm attempting to do this now with 0.10.0 and am seeing the Octokat BUG: Invalid Path. error

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

4 participants