Code Monkey home page Code Monkey logo

Comments (8)

croshchupkin avatar croshchupkin commented on May 12, 2024

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.

mdesetty avatar mdesetty commented on May 12, 2024

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

  1. Change handlebars-1 to handlebars-2 in the script src.
  2. 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.

croshchupkin avatar croshchupkin commented on May 12, 2024

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.

mdesetty avatar mdesetty commented on May 12, 2024

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.

noirbizarre avatar noirbizarre commented on May 12, 2024

Fixed by #20

from flask-restplus.

mdesetty avatar mdesetty commented on May 12, 2024

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.

croshchupkin avatar croshchupkin commented on May 12, 2024

+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.

ldgeo avatar ldgeo commented on May 12, 2024

👍

from flask-restplus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.