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

[Bug] Incompatible with Sanic>=21.0 #216

Closed
MSusik opened this issue Mar 22, 2021 · 4 comments
Closed

[Bug] Incompatible with Sanic>=21.0 #216

MSusik opened this issue Mar 22, 2021 · 4 comments

Comments

@MSusik
Copy link

MSusik commented Mar 22, 2021

Describe the bug

Can't start a simple app with Sanic 21.3. Works well with Sanic 20.12.2

Traceback (most recent call last):                                                                                       
 File "yon/app2.py", line 6, in <module>                                                                                   
app.blueprint(swagger_blueprint)                                                                                      
File "/usr/local/lib/python3.8/site-packages/sanic/app.py", line 421, in blueprint                                        
blueprint.register(self, options)                                                                                     
File "/usr/local/lib/python3.8/site-packages/sanic/blueprints.py", line 234, in register                                 
 route = app._apply_static(apply_route)                                                                                
File "/usr/local/lib/python3.8/site-packages/sanic/app.py", line 345, in _apply_static                                    
return self._register_static(static)                                                                                  
File "/usr/local/lib/python3.8/site-packages/sanic/mixins/routes.py", line 796, in _register_static                       
route, _ = self.route(                                                                                                
File "/usr/local/lib/python3.8/site-packages/sanic/mixins/routes.py", line 155, in decorator                              self._apply_route(route)                                                                                             
 File "/usr/local/lib/python3.8/site-packages/sanic/app.py", line 335, in _apply_route                                     
routes = self.router.add(**params)                                                                                    
File "/usr/local/lib/python3.8/site-packages/sanic/router.py", line 128, in add                                           
route = super().add(**params)  # type: ignore                                                                         
File "/usr/local/lib/python3.8/site-packages/sanic_routing/router.py", line 170, in add                                   route.add_handler(path, handler, method, requirements, overwrite)                                                     
File "/usr/local/lib/python3.8/site-packages/sanic_routing/route.py", line 114, in add_handler                            
raise RouteExists(                                                                                                  
sanic_routing.exceptions.RouteExists: Route already registered: swagger/ [GET] 

To Reproduce
Run the example from the documentation with Sanic 21.3

Environment (please complete the following information):

  • OS: [e.g. Ubuntu] Docker build on top of python:3.8-slim-buster or WSL with Ubuntu 18.04
  • Version [e.g. 0.5.3] 0.6.2
@artcg
Copy link
Contributor

artcg commented Mar 22, 2021

Yes sanic-openapi is broken with sanic 21.3, should be fixed in release next monday. Hope you can use sanic==20.12 until then...

@MSusik
Copy link
Author

MSusik commented Mar 22, 2021

Yes, that would work!

Thanks, I just was not sure if you are aware of this :)

@artcg
Copy link
Contributor

artcg commented Mar 23, 2021

Would appreciate it if you would test against https://github.com/artcg/sanic-openapi/tree/s21

So you can install like this

pip install git+https://github.com/artcg/sanic-openapi.git@s21

It works for my organisations project at least :)

and make sure you update sanic to the latest release (21.3.2 released today/yesterday -- previous version had a bug that affected sanic-openapi)

@artcg
Copy link
Contributor

artcg commented Mar 26, 2021

Closing this since sanic 21.3 is now implemented (#218)

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

2 participants