From e997713313c36808ac7052a218b253087622e179 Mon Sep 17 00:00:00 2001 From: jsurloppe Date: Mon, 1 Aug 2016 15:14:55 +0200 Subject: [PATCH] urljoin with leading slash remove part of path (#4332) --- 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(),