From 65c7b9d3f0e0be96ab13fc9451d73910ab97db79 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 12 Aug 2016 10:46:47 +0100 Subject: [PATCH] Add category/action examples --- rest_framework/schemas.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rest_framework/schemas.py b/rest_framework/schemas.py index a70a14e3d..0618e94fd 100644 --- a/rest_framework/schemas.py +++ b/rest_framework/schemas.py @@ -180,6 +180,16 @@ class SchemaGenerator(object): def get_category(self, path, method, callback, action): """ Return a descriptive category string for the endpoint, eg. 'users'. + + Examples of category/action pairs that should be generated for various + endpoints: + + /users/ [users][list], [users][create] + /users/{pk}/ [users][read], [users][update], [users][destroy] + /users/enabled/ [users][enabled] (custom action) + /users/{pk}/star/ [users][star] (custom action) + /users/{pk}/groups/ [groups][list], [groups][create] + /users/{pk}/groups/{pk}/ [groups][read], [groups][update], [groups][destroy] """ path_components = path.strip('/').split('/') path_components = [