Code Monkey home page Code Monkey logo

Comments (7)

luolingchun avatar luolingchun commented on August 25, 2024 2

Thank for your reply.
In my opinion, the first scheme is simpler for users. As before, users do not need to consider configuring static files.
If you agree, I can submit pull requests or you can handle it yourself.

from spectree.

luolingchun avatar luolingchun commented on August 25, 2024 2

Thank you, I have stored static files into my project, and have implemented offline swagger and redoc (refer to your source code and add two routes)

from spectree.

kemingy avatar kemingy commented on August 25, 2024 1

Welcome PR.

I have some concerns about this one.

  1. The offline mode should be an opt-in feature. By default, we should use the CDN to get the latest version.
  2. I don't want to add lots of static files into the code and update them later. There are some other ways to pack them into the Python library. Maybe downloading static files in the packaging stage or use the post-installation hook.

from spectree.

kemingy avatar kemingy commented on August 25, 2024

I just checked the static files. It mainly contains two sources:

There are several solutions:

  1. store these files in this library as extra data
    • need to update with this library
  2. pack these files into another library and use pip install spectree[offline] to install
    • can update separately

By the way, GitLab already supports rendering swagger UI with YAML/JSON file. So you can upload the generated openapi.json file to the GitLab repo for offline usage.

from spectree.

ariciputi avatar ariciputi commented on August 25, 2024

Hi,
I was looking for a way to serve the swagger/redoc static files without relaying on CDNs. In my case my app runs in an environment in which the outgoing requests to CDNs can be blocked.

@luolingchun can you elaborate on how you solved this? @kemingy are you willing to accept a PR adding an optional configuration for an alternative source for static files?

Thanks

from spectree.

luolingchun avatar luolingchun commented on August 25, 2024

@ariciputi You can go to my GitHub homepage,find the flask-openapi3 project and read the source code。The idea is to use blueprint manage the swagger/redoc static files。

from spectree.

ariciputi avatar ariciputi commented on August 25, 2024

@luolingchun thanks.

from spectree.

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.