class documentation

Original CoreAPI version.

Method __init__ Undocumented
Method determine_path_prefix Given a list of all paths, return the common prefix which should be discounted when generating a schema structure.
Method get_keys Return a list of keys that should be used to layout a link within the schema document.
Method get_links Return a dictionary containing all the links that should be included in the API schema.
Method get_schema Generate a `coreapi.Document` representing the API schema.
Class Variable default_mapping Undocumented
Instance Variable coerce_method_names Undocumented

Inherited from BaseSchemaGenerator:

Method coerce_path Coerce {pk} path arguments into the name of the model field, where possible. This is cleaner for an external representation. (Ie. "this is an identifier", not "this is a database primary key")
Method create_view Given a callback, return an actual view instance.
Method has_view_permissions Return `True` if the incoming request has the correct view permissions.
Instance Variable coerce_path_pk Undocumented
Instance Variable description Undocumented
Instance Variable endpoints Undocumented
Instance Variable patterns Undocumented
Instance Variable title Undocumented
Instance Variable url Undocumented
Instance Variable urlconf Undocumented
Instance Variable version Undocumented
Method _get_paths_and_endpoints Generate (path, method, view) given (path, method, callback) for paths.
Method _initialise_endpoints Undocumented
def __init__(self, title=None, url=None, description=None, patterns=None, urlconf=None, version=None): (source)
def determine_path_prefix(self, paths): (source)

Given a list of all paths, return the common prefix which should be discounted when generating a schema structure. This will be the longest common string that does not include that last component of the URL, or the last component before a path parameter. For example: /api/v1/users/ /api/v1/users/{pk}/ The path prefix is '/api/v1'

def get_keys(self, subpath, method, view): (source)

Return a list of keys that should be used to layout a link within the schema document. /users/ ("users", "list"), ("users", "create") /users/{pk}/ ("users", "read"), ("users", "update"), ("users", "delete") /users/enabled/ ("users", "enabled") # custom viewset list action /users/{pk}/star/ ("users", "star") # custom viewset detail action /users/{pk}/groups/ ("users", "groups", "list"), ("users", "groups", "create") /users/{pk}/groups/{pk}/ ("users", "groups", "read"), ("users", "groups", "update"), ("users", "groups", "delete")

def get_links(self, request=None): (source)

Return a dictionary containing all the links that should be included in the API schema.

def get_schema(self, request=None, public=False): (source)

Generate a `coreapi.Document` representing the API schema.

default_mapping: dict[str, str] = (source)

Undocumented

coerce_method_names = (source)

Undocumented