contiamo / restful-react

A consistent, declarative way of interacting with RESTful backends, featuring code-generation from Swagger and OpenAPI specs 🔥
MIT License
1.87k stars 109 forks source link

`--github` flag seems to no longer work #357

Closed azrosen92 closed 3 years ago

azrosen92 commented 3 years ago

Describe the bug When running restful-react import --github "username:repo:branch:path/to/openapi.yaml", the CLI always errors out with (node:77636) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'text' of null. This used to work, and nothing has changed about my configuration, so I'm wondering if there's been a change to the Github API which has broken this feature?

I printed out the response body in the restful-react script and it's returning

{
  "data": {
    "repository": {
      "object": null
    }
  }
}

It appears to be failing at this line, which tries to access to text from the returned file – https://github.com/contiamo/restful-react/blob/master/src/bin/restful-react-import.ts#L212.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

fabien0102 commented 3 years ago

Hello, can you make sure that your github token is up-to-date with the correct permission? (this is usually the case for this kind of error)

Anyway, I need to improve the error feedback for permission issues

(Note: I did try, this is working for me, we are using the github integration almost everyday, this is why I'm suspecting some bad configuration somewhere)

azrosen92 commented 3 years ago

Thank you! I think I found the permissions issue – I updated the README to fix it here https://github.com/contiamo/restful-react/pull/358