From f183a48de069ee05fc4f6945c0ed23cc87018ecd Mon Sep 17 00:00:00 2001 From: Julien Surloppe Date: Thu, 28 Jul 2016 21:54:45 +0200 Subject: [PATCH] urljoin with leading slash remove part of path --- rest_framework/schemas.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rest_framework/schemas.py b/rest_framework/schemas.py index 41dc82da1..02960083c 100644 --- a/rest_framework/schemas.py +++ b/rest_framework/schemas.py @@ -206,6 +206,9 @@ class SchemaGenerator(object): else: encoding = None + if self.url and path.startswith('/'): + path = path[1:] + return coreapi.Link( url=urlparse.urljoin(self.url, path), action=method.lower(),