From fe53fc321159a11093590bc166a8e8dea5b0dbca Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Thu, 9 Aug 2018 11:20:31 +0200 Subject: [PATCH] Remove get_link() stub from ViewInspector base class. Open API has get_operation() --- rest_framework/schemas/inspectors.py | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/rest_framework/schemas/inspectors.py b/rest_framework/schemas/inspectors.py index 52f0fe3d6..3ec9ea37f 100644 --- a/rest_framework/schemas/inspectors.py +++ b/rest_framework/schemas/inspectors.py @@ -174,20 +174,6 @@ class ViewInspector(object): def view(self): self._view = None - def get_link(self, path, method, base_url): - """ - Generate `coreapi.Link` for self.view, path and method. - - This is the main _public_ access point. - - Parameters: - - * path: Route path for view from URLConf. - * method: The HTTP request method. - * base_url: The project "mount point" as given to SchemaGenerator - """ - raise NotImplementedError(".get_link() must be overridden.") - class AutoSchema(ViewInspector): """ @@ -208,6 +194,17 @@ class AutoSchema(ViewInspector): self._manual_fields = manual_fields def get_link(self, path, method, base_url): + """ + Generate `coreapi.Link` for self.view, path and method. + + This is the main _public_ access point. + + Parameters: + + * path: Route path for view from URLConf. + * method: The HTTP request method. + * base_url: The project "mount point" as given to SchemaGenerator + """ fields = self.get_path_fields(path, method) fields += self.get_serializer_fields(path, method) fields += self.get_pagination_fields(path, method)