-
Notifications
You must be signed in to change notification settings - Fork 175
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
Docs storage directory is constantly being overwritten #61
Comments
Yeah it looks like commit d2b6848 introduced the change. I prefer the original approach and as I can't determine when you'd want to recreate the directory like it's doing now. I know the json file changed between Swagger versions but that should be the only thing generation touches to my knowledge. If deleting that file before writing to it is a problem then we can just delete that one file explicitly, not the entire directory. |
Is this the issue causing my path "/api-docs" not found? |
It's possible but probably not. In your If you're getting path not found, it likely points to |
@w0rd-driven actually my |
I would ask what version you're using but that's really hard to track. There was a recent change that adds What is the output of |
I haven't that string in my config and artisan gives me error
|
Hrm I've never seen that before. When's the last time you updated this package? You may not need that section in your config file if you haven't updated in awhile. If you've updated recently then chances are you'll need that. |
I'm an "update maniac" :D So i'm sure I have the last version of swaggervel. I've just tried putting Could be an incomplete update? |
I personally changed mine back to api-docs. That was a breaking change introduced in the patch that should be reverted. I also had to update I found that using |
Things are getting strange! If i replace And nothing changes if I remove the |
Hrm I'm really stumped. If you know how to inspect the vendor code, I would try to make sure I was on the latest version of the package. You may just want to delete your config, re-run the publish command and look at the diff of what's changed in git. There may be more config dependencies. You could also try to use "api/docs" as before and open Chrome to look for any 404 errors. If you get no CSS applied giving you at least the top portion of the Swagger UI then it can't find the assets in the public folder. If you're getting that but no API generated then something is bombing when it's trying to generate your docs. Have you tried going to the |
https://github.com/slampenny/Swaggervel/blob/master/src/Jlapp/Swaggervel/routes.php#L24 points to the codepath being hit.
For current Swagger runs via the CLI, it doesn't recreate the output directory at all it just dumps the file. The part of the if statement that passes is the is_writeable($docsDir) which always returns true. This causes the entire directory to be overwritten every generation.
A temporary fix for my deployment issues was to add /storage/docs to the top level .gitignore file but I'd rather it be like all the other storage directories with a self-contained .gitignore file. I'll work on a PR for this shortly.
The text was updated successfully, but these errors were encountered: