From 06df61e38c6ed99732007b0e9f3cc26e8317389e Mon Sep 17 00:00:00 2001 From: Rex Salisbury Date: Mon, 7 Nov 2016 03:41:10 -0800 Subject: [PATCH] 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... --- rest_framework/schemas.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rest_framework/schemas.py b/rest_framework/schemas.py index 9439cb691..773df6261 100644 --- a/rest_framework/schemas.py +++ b/rest_framework/schemas.py @@ -263,6 +263,8 @@ class SchemaGenerator(object): view_endpoints.append((path, method, view)) # Only generate the path prefix for paths that will be included + if not paths: + return None prefix = self.determine_path_prefix(paths) for path, method, view in view_endpoints: