Redocly/create-openapi-repo

Getting 404 for Swagger docs in Github pages

jaynarathod opened this issue · 9 comments

I tried using https://swagger.io/blog/api-development/generator-openapi-repo/ for generating Swagger docs and host them on GitHub, but getting a 404 for my apis specs:

Here is the API link
Documentation(ReDoc): https://jaynarathod.github.io/spring-boot-docs/
SwaggerUI: https://jaynarathod.github.io/spring-boot-docs/swagger-ui/

Repo https://github.com/jaynarathod/spring-boot-docs

Thanks for the reply @RomanGotsiy
I was not able to finish the build on Travis,

I get the following error
exec git config --get remote.origin.url
https://github.com/jaynarathod/github-docs-spring.git
rm -rf .ghpages-tmp
mkdir -p .ghpages-tmp
cd .ghpages-tmp
exec git clone --depth=1 --branch=gh-pages https://github.com/jaynarathod/github-docs-spring.git .
Cloning into '.'...
warning: Could not find remote branch gh-pages to clone.
fatal: Remote branch gh-pages not found in upstream origin
exec: internal error
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! GH-Pages-openapi-spec@0.0.1 deploy: npm run build && deploy-to-gh-pages --update web_deploy
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the GH-Pages-openapi-spec@0.0.1 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/travis/.npm/_logs/2018-06-20T18_17_40_837Z-debug.log

Any insights on the error @RomanGotsiy ?

@jaynarathod could you try the approach described here: #8?
looks like you have same issue

Thanks @RomanGotsiy ! That worked for me, adding a new branch called "gh-pages"
But the API documentation I see is not what my API specs have.I see the default echo and user APIs in docs? Any idea why? My swagger APIs on local machine do show the right APIs in the docs

@RomanGotsiy Did I miss something with the above ^^ ?

Thanks @RomanGotsiy ! That worked for me, adding a new branch called "gh-pages"
But the API documentation I see is not what my API specs have.I see the default echo and user APIs in docs? Any idea why? My swagger APIs on local machine do show the right APIs in the docs

I experienced something similar, but visiting the spec URL in an incognito window shows the most recent changes.

Also getting a 404 for the Swagger-UI. No evidence of any Swagger-UI folder or index page created in a repo as a result of running the script. Redoc web created as expected, and no errors when running the script either.

I'm using AWS CodeBuild as the CI environment with the environment variables:
GH_TOKEN, TRAVIS_REPO_SLUG and TRAVIS set.

Closing as stale