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

Prepend the swagger routes instead of appending. #28

Merged
merged 2 commits into from
Sep 6, 2020

Conversation

nimpsch
Copy link

@nimpsch nimpsch commented Jun 19, 2020

First of all thank you for your great package, it works very well!

Why the change?

When using a static file handler, the swagger routes will be appended to the routes list. Therefore, the static file handler doesn't work anymore.

Current way to fix the issue:

routes = [  
        tornado.web.url(r'/api2', Handler2),  
        tornado.web.url(r'/api', Handler)
    ]  
setup_swagger(routes=routes)  
routes.append(tornado.web.url(r'/(.*)', tornado.web.StaticFileHandler, {'path': 'path'}))  
swagger_app = tornado.web.Application(routes)

Proposal:

Prepend the swagger handler instead of appending.

Desired result:

routes = [  
    tornado.web.url(r'/api2', Handler2),  
    tornado.web.url(r'/api', Handler),  
    tornado.web.url(r'/(.*)', tornado.web.StaticFileHandler, {'path': 'path'})  
]  
setup_swagger(routes=routes)  
swagger_app = tornado.web.Application(routes)

For the failing build:
Gitlab Issue

@sonarcloud
Copy link

sonarcloud bot commented Jun 19, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@mrk-andreev mrk-andreev merged commit 7694217 into mrk-andreev:master Sep 6, 2020
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

Successfully merging this pull request may close these issues.

2 participants