Forum Discussion

djs's avatar
djs
Occasional Contributor
9 years ago
Solved

GitHub integration not working for me

I'm trying to push an API definition to GitHub.

 

I navigated to the Editor for the API, selected "Edit GitHub Push" from the "+" menu, entered the GitHub repository information and checked the "Enabled" box. When saving the details a message popped up telling me that the GitHub push configuration wa saved successfully. 

 

When I go to the "Show my APIs" page the Git icon is disabled next to all of my APIs, including the one I configured. If I click on it I get a message telling me that "GitHub has not been associated with this API".

 

Looks like I must have missed a step - can anyone point me in the right direction?

 

Thanks.

David

  • Hi David!  There are two aspects for GitHub push.

     

    1) Pushing your definitions upon save.  That's what it sounds like you have configured, and based on the filename, SwaggerHub will push either a JSON or YAML version directly to github.  Check your repository to verify that.

     

    2) Linking a GitHub repo to your account.  This is slightly different from above, it essentially hot-links the GitHub logo from your APIs page to the repo.  To configure that, click the "+" => Edit API Info => GitHub Link.  Then it will hot-link directly to your repo.

     

    I will get this added to the FAQ as well, please reply with any other questions!

  • Hi, we have addressed the push issue.  If your output file has the suffix ".json", it'll be saved as JSON.  Otherwise, YAML.

     

    Please let us know how it goes!

5 Replies

  • Hi David!  There are two aspects for GitHub push.

     

    1) Pushing your definitions upon save.  That's what it sounds like you have configured, and based on the filename, SwaggerHub will push either a JSON or YAML version directly to github.  Check your repository to verify that.

     

    2) Linking a GitHub repo to your account.  This is slightly different from above, it essentially hot-links the GitHub logo from your APIs page to the repo.  To configure that, click the "+" => Edit API Info => GitHub Link.  Then it will hot-link directly to your repo.

     

    I will get this added to the FAQ as well, please reply with any other questions!

    • djs's avatar
      djs
      Occasional Contributor

      Ah - user error as I suspected. Thanks for the clarification, it's working fine now I understand what it expect. 

       

      I have a follow-up question. I work in YAML in the editor and I am able to download both YAML and JSON versions of the API. But it looks like the push to GitHub only supports JSON? If I load JSON into the editor is it then possible to return to a YAML view? (Apologies for newbie questions.) 

       

      BTW - the editor and the whole SwaggerHub platform is great.

      • fehguy's avatar
        fehguy
        Staff

        Hi, it appears that the push as YAML has a regression--I'll get that addressed and post back shortly.  Thanks for bringing that to our attention.