44from ellar .common import IIdentitySchemes
55from ellar .common .compatible import AttributeDict , cached_property
66from ellar .common .constants import GUARDS_KEY
7- from ellar .core .routing import ControllerRouteOperation , EllarMount , RouteOperation
8- from ellar .openapi .constants import OPENAPI_OPERATION_KEY , OPENAPI_TAG , REF_TEMPLATE
7+ from ellar .core .routing import (
8+ ControllerRouteOperation ,
9+ EllarControllerMount ,
10+ RouteOperation ,
11+ )
12+ from ellar .openapi .constants import (
13+ IGNORE_CONTROLLER_TYPE ,
14+ OPENAPI_OPERATION_KEY ,
15+ OPENAPI_TAG ,
16+ REF_TEMPLATE ,
17+ )
918from ellar .pydantic import (
1019 EmailStr ,
1120 GenerateJsonSchema ,
@@ -54,17 +63,20 @@ def _get_openapi_route_document_models(self, app: "App") -> t.List[OpenAPIRoute]
5463
5564 for route in app .routes :
5665 if (
57- isinstance (route , EllarMount )
66+ isinstance (route , EllarControllerMount )
5867 and len (route .routes ) > 0
5968 and route .include_in_schema
60- and route .get_control_type ()
69+ and route .get_controller_type ()
6170 ):
62- control_type = route .get_control_type ()
71+ control_type = route .get_controller_type ()
6372 assert control_type
6473
6574 openapi_tags = AttributeDict (
6675 reflector .get (OPENAPI_TAG , control_type ) or {}
6776 )
77+ ignore_tag = (
78+ reflector .get (IGNORE_CONTROLLER_TYPE , control_type ) or False
79+ )
6880 if route .name :
6981 openapi_tags .setdefault ("name" , route .name )
7082
@@ -80,7 +92,7 @@ def _get_openapi_route_document_models(self, app: "App") -> t.List[OpenAPIRoute]
8092 ),
8193 )
8294 )
83- if openapi_tags :
95+ if openapi_tags and not ignore_tag :
8496 self ._build .setdefault ("tags" , []).append (openapi_tags )
8597 elif (
8698 isinstance (route , (RouteOperation , ControllerRouteOperation ))
@@ -126,7 +138,7 @@ def create_document(self, app: "App") -> OpenAPI:
126138 separate_input_output_schemas = True ,
127139 )
128140
129- # mounts: t.List[t.Union[BaseRoute, EllarMount , Mount]] = []
141+ # mounts: t.List[t.Union[BaseRoute, EllarControllerMount , Mount]] = []
130142 # for _, item in app.injector.get_templating_modules().items():
131143 # mounts.extend(item.routers)
132144
0 commit comments