# Path: src/bananas/admin/api/versioning.py
# class BananasVersioning(NamespaceVersioning):
# 
#     default_version: str = v1_0.__version__
#     allowed_versions: Sequence[str] = tuple(
#         version.__version__ for version in __versions__
#     )
#     version_map: Dict[str, ModuleType] = {
#         version.__version__: version for version in __versions__
#     }
# 
#     def get_versioned_viewname(self, viewname: str, request: Request) -> str:
#         """
#         Prefix viewname with full namespace bananas:vX.Y:
#         """
#         namespace = request.resolver_match.namespace
#         if namespace:
#             viewname = f"{namespace}:{viewname}"
# 
#         return viewname
# 
# Path: src/bananas/admin/api/schemas/base.py
# class BananasBaseRouter:
#     def get_default_basename(self, viewset: Type[ViewSetMixin]) -> str:
#         return cast(Type["BananasAPI"], viewset).get_admin_meta().basename  # type: ignore[no-any-return]
# 
#     def get_schema_view(self) -> Any:
#         raise NotImplementedError


from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, cast
from django.conf import settings
from django.urls.exceptions import NoReverseMatch
from django.utils.translation import gettext as _
from drf_yasg import openapi
from drf_yasg.generators import EndpointEnumerator, OpenAPISchemaGenerator
from drf_yasg.inspectors.view import SwaggerAutoSchema
from drf_yasg.views import get_schema_view
from rest_framework import permissions, viewsets
from rest_framework.authentication import SessionAuthentication
from rest_framework.request import Request
from rest_framework.routers import SimpleRouter
from rest_framework.schemas.coreapi import is_custom_action
from ..versioning import BananasVersioning
from .base import BananasBaseRouter

        view_method = getattr(view, view.action, None)
        if view_method:
            include_tags = set(getattr(view_method, "include_tags", None) or [])
            exclude_tags = set(getattr(view_method, "exclude_tags", None) or [])
            tags |= include_tags
            tags -= exclude_tags

        return [tag for tag in tags if tag not in meta.exclude_tags]

    def is_navigation(self) -> bool:
        if not hasattr(self, "_is_navigation"):
            self._is_navigation = False
            try:
                if self.method == "GET" and (
                    self.view.action == "list" or not hasattr(self.view, "list")
                ):
                    self.view.reverse_action("list")
                    self._is_navigation = True
            except NoReverseMatch:
                pass

        return self._is_navigation


class BananasSimpleRouter(BananasBaseRouter, SimpleRouter):
    def get_schema_view(self) -> Any:
        view = get_schema_view(
            openapi.Info(
                title="Django Bananas Admin API Schema",

# Path: src/bananas/admin/api/versioning.py
# class BananasVersioning(NamespaceVersioning):
# 
#     default_version: str = v1_0.__version__
#     allowed_versions: Sequence[str] = tuple(
#         version.__version__ for version in __versions__
#     )
#     version_map: Dict[str, ModuleType] = {
#         version.__version__: version for version in __versions__
#     }
# 
#     def get_versioned_viewname(self, viewname: str, request: Request) -> str:
#         """
#         Prefix viewname with full namespace bananas:vX.Y:
#         """
#         namespace = request.resolver_match.namespace
#         if namespace:
#             viewname = f"{namespace}:{viewname}"
# 
#         return viewname
# 
# Path: src/bananas/admin/api/schemas/base.py
# class BananasBaseRouter:
#     def get_default_basename(self, viewset: Type[ViewSetMixin]) -> str:
#         return cast(Type["BananasAPI"], viewset).get_admin_meta().basename  # type: ignore[no-any-return]
# 
#     def get_schema_view(self) -> Any:
#         raise NotImplementedError


# Path: src/bananas/admin/api/schemas/yasg.py
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, cast
from django.conf import settings
from django.urls.exceptions import NoReverseMatch
from django.utils.translation import gettext as _
from drf_yasg import openapi
from drf_yasg.generators import EndpointEnumerator, OpenAPISchemaGenerator
from drf_yasg.inspectors.view import SwaggerAutoSchema
from drf_yasg.views import get_schema_view
from rest_framework import permissions, viewsets
from rest_framework.authentication import SessionAuthentication
from rest_framework.request import Request
from rest_framework.routers import SimpleRouter
from rest_framework.schemas.coreapi import is_custom_action
from ..versioning import BananasVersioning
from .base import BananasBaseRouter


        view_method = getattr(view, view.action, None)
        if view_method:
            include_tags = set(getattr(view_method, "include_tags", None) or [])
            exclude_tags = set(getattr(view_method, "exclude_tags", None) or [])
            tags |= include_tags
            tags -= exclude_tags

        return [tag for tag in tags if tag not in meta.exclude_tags]

    def is_navigation(self) -> bool:
        if not hasattr(self, "_is_navigation"):
            self._is_navigation = False
            try:
                if self.method == "GET" and (
                    self.view.action == "list" or not hasattr(self.view, "list")
                ):
                    self.view.reverse_action("list")
                    self._is_navigation = True
            except NoReverseMatch:
                pass

        return self._is_navigation


class BananasSimpleRouter(BananasBaseRouter, SimpleRouter):
    def get_schema_view(self) -> Any:
        view = get_schema_view(
            openapi.Info(
                title="Django Bananas Admin API Schema",

                default_version=BananasVersioning.default_version,