mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-07 13:54:47 +03:00
Add category/action examples
This commit is contained in:
parent
8385ac56db
commit
65c7b9d3f0
|
@ -180,6 +180,16 @@ class SchemaGenerator(object):
|
||||||
def get_category(self, path, method, callback, action):
|
def get_category(self, path, method, callback, action):
|
||||||
"""
|
"""
|
||||||
Return a descriptive category string for the endpoint, eg. 'users'.
|
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 = path.strip('/').split('/')
|
||||||
path_components = [
|
path_components = [
|
||||||
|
|
Loading…
Reference in New Issue
Block a user