@JsonMiddleware doesn´t work with all_urls()
exidio opened this issue · comments
exidio commented
Submitting...
- Bug
- Feature
- Question
- Documentation issue
If i want to use return state(__name__).routes.keys()
I get the error message below.
Error Log
127.0.0.1 - - [22/Feb/2018 09:47:55] "GET /urls HTTP/1.1" 200 -
Error on request:
Traceback (most recent call last):
File "C:\Users\i01002734\AppData\Local\Programs\Python\Python36\lib\site-packages\werkzeug\serving.py", line 270, in run_wsgi
execute(self.server.app)
File "C:\Users\i01002734\AppData\Local\Programs\Python\Python36\lib\site-packages\werkzeug\serving.py", line 261, in execute
write(data)
File "C:\Users\i01002734\AppData\Local\Programs\Python\Python36\lib\site-packages\werkzeug\serving.py", line 241, in write
assert isinstance(data, bytes), 'applications must write bytes'
AssertionError: applications must write bytes
Expected behavior
It should give out all routes
How to reproduce the problem
Just use the return code above and call the route
Environment
OS: Windows 10
Swapy version: 0.2.1
Python version: 3.6.3
Daniel Däschle commented
dict.keys()
returns a dict_keys object. Json is only str
, list
, dict
, int
and float
(please forgive me if i forget one).
Commit 87c9a6f fixes this and inserts routes()
function. Just use this instead with swapy.routes()
.