jmcarp / flask-apispec

MIT License
655 stars 156 forks source link

Version 0.11.1 breaks swagger-ui #235

Closed myouds closed 2 years ago

myouds commented 2 years ago

Using flask-apispec 0.11.1, browsing to /swagger-ui gives an empty page and the following 404 errors on the server:

192.168.1.11 - - [2022-03-30 09:42:39] "GET /swagger-ui/ HTTP/1.1" 200 1232 0.003990
192.168.1.11 - - [2022-03-30 09:42:39] "GET /flask-apispec/static/swagger-ui.css HTTP/1.1" 404 356 0.000479
192.168.1.11 - - [2022-03-30 09:42:39] "GET /flask-apispec/static/swagger-ui-bundle.js HTTP/1.1" 404 356 0.000257
192.168.1.11 - - [2022-03-30 09:42:39] "GET /flask-apispec/static/swagger-ui-standalone-preset.js HTTP/1.1" 404 356 0.000201
192.168.1.11 - - [2022-03-30 09:42:39] "GET /flask-apispec/static/favicon-16x16.png HTTP/1.1" 404 356 0.000442

Downgrading to 0.11.0 fixes this issue. Since the 404 errors are coming from /flask-apispec/static files, it makes sense that the cause is probably this change: https://github.com/jmcarp/flask-apispec/pull/233/files#diff-94b40f070e00775bf4e586dd00cd651e54edeeefd229a83f07335dd1b3d935b1

calebevans commented 2 years ago

Maybe this is a similar issue to #22 ?

HandBoy commented 2 years ago

I have this problem too. To solve it I deleted my environment, create another and install the requirements with flask-apispec 0.11.0.

shearichard commented 2 years ago

Just to confirm that uninstalling 0.11.1 and installing 0.11.0 fixed it for me.

I'm using pipenv so it went like this but it won't be far off if you're using something else.

pipenv uninstall flask-apispec
pipenv install flask-apispec==0.11.0
wizardofzos commented 2 years ago

Confirming 0.11.1 breaks with Jinja2 at 3.1.2 and Flask at 2.1.2 Downgrading to 0.11.0 did solve the issue.

thinking the fix in "74fb2048d0164a..." is bit too ' generic. As it does not break /swagger URL but it does break /swagger-ui

matiasrebori commented 2 years ago

had the same problem, pip install flask-apispec==0.11.0, solve the issue

jbarreneche commented 2 years ago

I'm not sure how the package is published, but for what I can see, when I install the version 0.11.0 locally, the site-packages contain the static files (eg. swagger-ui.css) but those files aren't installed with the version 0.11.1. It seems that there's a task to generate those static files: https://github.com/jmcarp/flask-apispec/blob/master/tasks.py and I assume they get packaged when pushed the version to pypi (since there's no reference to that task on setup.py and that task depends on npm)

IMO, we need a new release with those static file. Any chance that could happen or is the project is abandoned?

freelancing-solutions commented 2 years ago

yep just install 0.11.0

stufisher commented 2 years ago

@sloria any idea on this one? Still looks to be broken with the 0.11.2 release, you can see on conda-forge the static files are missing based on the package size: https://anaconda.org/conda-forge/flask-apispec/files

I suppose this was handled by travis before (last successful build for 0.11.0 https://travis-ci.org/github/jmcarp/flask-apispec/builds) and now you are publishing the package manually? Maybe just needs an invoke install before running sdist?

sloria commented 2 years ago

Ah you're right; @stufisher . Thanks for looking into it.

I've released 0.11.3 which includes the static files