You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
My api have an optional group on route, and it braaks on start when I use tornado-swagger library
To Reproduce
Steps to reproduce the behavior:
My api is configured as above
handlers= [
url(r'/(?:status)?', StatusHandler),
# other handlers
]
setup_swagger(handlers)
app=Application(handlers)
When I run, the following error occurs:
File "/project/path/venv/lib/python3.8/site-packages/tornado_swagger/setup.py", line 58, in setup_swagger
swagger_schema = generate_doc_from_endpoints(
File "/project/path/venv/lib/python3.8/site-packages/tornado_swagger/_builders.py", line 276, in generate_doc_from_endpoints
return doc_builders[api_definition_version].generate_doc(
File "/project/path/venv/lib/python3.8/site-packages/tornado_swagger/_builders.py", line 240, in generate_doc
"paths": _extract_paths(routes),
File "/project/path/venv/lib/python3.8/site-packages/tornado_swagger/_builders.py", line 124, in _extract_paths
paths[_format_handler_path(route, method_name)].update({method_name: method_description})
File "/project/path/venv/lib/python3.8/site-packages/tornado_swagger/_builders.py", line 94, in _format_handler_path
route_pattern = route_pattern.replace(entity, "{%s}" % parameters[i], 1)
IndexError: list index out of range
It is because there is no parameter
Expected behavior
The aplications should show urls like this
Additional context
For now, I am duplicating entry, but It sims not correct for me
Issue with IndexError was fixed in 1.4.4. Actual behavior is ignore paths like this.
I think that use optionals in path does not cover rest api url convention best practices. Unfortunately I have no plant for support every regexp in path. Furthermore tornado does not recognize this regexp, too.
Describe the bug
My api have an optional group on route, and it braaks on start when I use tornado-swagger library
To Reproduce
Steps to reproduce the behavior:
My api is configured as above
When I run, the following error occurs:
It is because there is no parameter
Expected behavior
The aplications should show urls like this
Additional context
For now, I am duplicating entry, but It sims not correct for me
The text was updated successfully, but these errors were encountered: