Comments (8)
Also, I tried overloading the template with my own that included the correct JS file. Now I get a javascript error in Firebug: "ReferenceError: marked is not defined" for swagger-ui.js (line 370, col 13).
The line itself is:
return $(this).html(marked($(this).html()));
from flask-restplus.
I have a fix and planning to submit a pull request. Here is the fix if you need it. It solved the issues for me
In swagger-ui-libs.html
swagger-ui-libs.html under Virtual env \env\Lib\site-packages\flask_restplus\templates\swagger-ui-libs.html
- Change handlebars-1 to handlebars-2 in the script src.
- and Add (Add angled bracket at the start and end for the script tag. Form is stripping it if I add it)
script src="{{ swagger_static('lib/marked.js') }}" type="text/javascript"></script
at end to the swagger-ui-libs.html.
That should fix it.
from flask-restplus.
yes, I changed the handlebars' version in my custom template. As for marked, it seems that the Swagger UI for my REST API is still generated even without it.
from flask-restplus.
You have to manually add it into your virtual env for now. I submitted a pull request and once its merged the Swagger UI for your REST API will get it when you create a new virtualenv. Until then you have to change the template manually in your virtualenv.
from flask-restplus.
Fixed by #20
from flask-restplus.
Any timeline when the flask-restfplus package (probably a new version 0.4.3?) will be published to PyPi so that when pip is used it will install these changes from the PyPI?
from flask-restplus.
+1
I also think it would be great if this fix was tagged with a new version to make referencing it in requirements.txt easier.
from flask-restplus.
👍
from flask-restplus.
Related Issues (20)
- No zeros (0) displayed in the swagger-ui documentation examples, if provided as a number
- ERR_NAME_NOT_RESOLVED when accessing swagger doc
- Need Implementation Example HOT 4
- [Question] Import existing spec file swagger.json to Flask Restplus
- Scheme to replace swagger.json HOT 2
- flask_restx is not compatible with gunicorn HOT 1
- Issue related to api summary HOT 1
- DDtrace auto instrumentation does not work for flaskrestplus apis PATCH, POST
- With nested api model expect is raising error with key not found.
- App runs locally but returns 500 error on Heroku
- Values in nested api model are null HOT 2
- Add support for OpenAPI (Swagger 3.0) HOT 1
- Provide doc that api.expect doesn't support multipart form data HOT 1
- Latest Release is older than current master by 2.5 years. HOT 1
- How to use swagger with a old flask project. HOT 1
- Package not working with Python 3.10 HOT 1
- Setting jwt_token in head does not show in cUrl
- got_request_exception signal repeat execution HOT 1
- Download 100K records in csv format HOT 1
- python3-flask-restplus_0.13.0.bb
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flask-restplus.