Skip to content
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

How to customize swagger html #71

Open
PabloCastellano opened this issue Jan 21, 2015 · 3 comments
Open

How to customize swagger html #71

PabloCastellano opened this issue Jan 21, 2015 · 3 comments

Comments

@PabloCastellano
Copy link

Hi.

In a project I want to customize the default swagger web interface.
What's the easiest way to do it? I haven't found any documentation.

I could just edit the files in the static/ folder but I wanted to know if there's some mechanism like copying the static folder from this plugin to my root folder and just edit them there.

@hwdavidward
Copy link

+1

@nickvasilyev
Copy link

I have a workaround:
I was able to make a directory called swagger inside my flask app's static folder and put the static files from this project in there. Then to use them, you can change render_page function (like 175) to not include the base url. The specific line that needs to be changed is:

with open(os.path.join(rootPath, 'static', page), "r") as fs:

Change it to:

with open(os.path.join('static/swagger', page), "r") as fs:

However, you probably just want to include the rendering as part of your own project so it can have the same look and feel as the rest of your site.

@niall-byrne
Copy link
Collaborator

If the workaround is effective, it may make sense to close this issue off.
@nickvasilyev @hwdavidward @PabloCastellano Would you guys like to weigh in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants