Remove the APIRoot view. Remove the Endpoint class. Remove the EndpointSerializer. Move API documentation generation from the root urls module to the app's urls module. Update the app API URL generation to be based on viewsets instead of an custom api_urls list. Remove MayanObjectPermissionsFilter and replace it with MayanViewSetObjectPermissionsFilter which allows mapping a required permission to a specific viewset action. Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
25 lines
684 B
Python
25 lines
684 B
Python
from __future__ import unicode_literals
|
|
|
|
from django.utils.translation import ugettext_lazy as _
|
|
|
|
from mayan.apps.navigation import Link
|
|
|
|
from .icons import (
|
|
icon_api, icon_api_documentation, icon_api_documentation_redoc
|
|
)
|
|
|
|
|
|
link_api = Link(
|
|
icon_class=icon_api, tags='new_window', text=_('REST API'),
|
|
view='rest_api:api-root'
|
|
)
|
|
link_api_documentation = Link(
|
|
icon_class=icon_api_documentation, tags='new_window',
|
|
text=_('API Documentation (Swagger)'), view='rest_api:schema-swagger-ui'
|
|
)
|
|
|
|
link_api_documentation_redoc = Link(
|
|
icon_class=icon_api_documentation_redoc, tags='new_window',
|
|
text=_('API Documentation (ReDoc)'), view='rest_api:schema-redoc'
|
|
)
|