class SchemaGenerator(BaseSchemaGenerator): (source)
Original CoreAPI version.
Method | __init__ |
Undocumented |
Method | determine |
Given a list of all paths, return the common prefix which should be discounted when generating a schema structure. |
Method | get |
Return a list of keys that should be used to layout a link within the schema document. |
Method | get |
Return a dictionary containing all the links that should be included in the API schema. |
Method | get |
Generate a `coreapi.Document` representing the API schema. |
Class Variable | default |
Undocumented |
Instance Variable | coerce |
Undocumented |
Inherited from BaseSchemaGenerator
:
Method | coerce |
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 |
Given a callback, return an actual view instance. |
Method | has |
Return `True` if the incoming request has the correct view permissions. |
Instance Variable | coerce |
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 |
Generate (path, method, view) given (path, method, callback) for paths. |
Method | _initialise |
Undocumented |
Undocumented
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'
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")