diff --git a/rest_framework/schemas.py b/rest_framework/schemas.py index 773df6261..0dff8a171 100644 --- a/rest_framework/schemas.py +++ b/rest_framework/schemas.py @@ -452,6 +452,9 @@ class SchemaGenerator(object): """ fields = [] + if not hasattr(uritemplate, 'variables'): + return fields + for variable in uritemplate.variables(path): field = coreapi.Field(name=variable, location='path', required=True) fields.append(field)