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

Page Not Found error when accessing api-docs #72

Open
krisbrkrunch opened this issue Jun 3, 2016 · 2 comments
Open

Page Not Found error when accessing api-docs #72

krisbrkrunch opened this issue Jun 3, 2016 · 2 comments

Comments

@krisbrkrunch
Copy link

krisbrkrunch commented Jun 3, 2016

When I setup my composer.json to use the master-dev branch I get pageNotFound error, if I use the 2.0 branch like the readme says I get Class Swagger/Swagger not found Error.

So far the only way to get the project working is to use the the forked branch https://github.com/tralves/Swaggervel in my composer.json this fork however uses the swagger-ui from the 1.0 spec but then uses the swagger-php from the 2.0 spec so I also had to force composer to use swagger 1.0 with "zircote/swagger-php": "1.0" then go back to 1.0 annotation...

That was my only solution after fighting with this until 4am, but would love to use the 2,0 annotations. I might try just downloading the master branch manually and replacing the files in the public vendor folder manually to see if that updates this tralves fork swagger-ui to 2.0.
UPDATE: copying the public vendor files manually did not work, it gave javascript errors invalid tokens on <! document, and undefined class SwaggerUI even though the script include for swager-ui.js in the header was valid and readable.

@krisbrkrunch
Copy link
Author

UPDATE: I have Swagger UI working with 2.0 swagger annotations! Finally!
Here is what I had to do:
I used the master-dev branch in composer for slampenny/swaggervel
I had to change the route.php file under jlapp/swaggervel/routes.php to the one from https://github.com/tralves/Swaggervel that stops the pagenotfound error! Magic.
Next I was getting a bunch of JS errors on api-docs page and it wasnt loading annotations. I noticed the blade template in /resources/vendor/swaggervel/index.blade.php was using handlebars 1.0 js file so I changed this to the new 2.0 that swagger-ui now uses. I then removed swagger.js and shred script includes as they were not found, and then finally I had to remove all the log('Loaded Swagger') commands for some reason it could not find the log command even though I did see it inside swagger-ui.js

After all that it works, I think i may create a fork with all the changes so the next person can just use that fork in there composer.js and BAM a working version of swaggervel!

@krisbrkrunch
Copy link
Author

Ok I think the problem with the master branch was only the route is pointing to api/docs instead of api-docs, when I changed it to api-docs everything is working so I think its just a typo in the latest branch. That and the wrong version of handlebars was in the view along with probs source includes.

I have created a fork here https://github.com/krisbray/swaggervel
I was able to test a new branch of my project and pull from my fork instead using composer and everything works right off the hop. hope this saves someone else the time I had to put in to figure it out! :D

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

1 participant