Commit 06df61e3 by Rex Salisbury Committed by Tom Christie

handle error when no links are found (#4649)

This is to address https://github.com/tomchristie/django-rest-raml/issues/5

The problem is that if you try to generate RAML docs when you haven't set up any views, you get the above error (min called on an empty list).  

unfortunately, this PR is not very helpful since it doesn't actually surface a readable error to the user.  Not sure what the best way to address this would be...
parent ee60aaa9
...@@ -263,6 +263,8 @@ class SchemaGenerator(object): ...@@ -263,6 +263,8 @@ class SchemaGenerator(object):
view_endpoints.append((path, method, view)) view_endpoints.append((path, method, view))
# Only generate the path prefix for paths that will be included # Only generate the path prefix for paths that will be included
if not paths:
return None
prefix = self.determine_path_prefix(paths) prefix = self.determine_path_prefix(paths)
for path, method, view in view_endpoints: for path, method, view in view_endpoints:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment