From f6d04e651a73f076757a45948533ce44ecd692cb Mon Sep 17 00:00:00 2001 From: sol HYUN Date: Thu, 23 Mar 2017 17:42:08 +0900 Subject: [PATCH] Add make_typical_path method. --- rest_framework/schemas.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rest_framework/schemas.py b/rest_framework/schemas.py index 27434d337..b2cfe4d77 100644 --- a/rest_framework/schemas.py +++ b/rest_framework/schemas.py @@ -336,6 +336,15 @@ class SchemaGenerator(object): # Methods used when we generate a view instance from the raw callback... + def make_typical_path(self, path): + """ + Removes '/' from path and returns a linked value using '-'. + """ + ret = [ partial for partial in path.split('/') + if partial and '{' not in partial ] + return '-'.join(ret) + + def create_view(self, callback, method, request=None): """ Given a callback, return an actual view instance.