File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -450,7 +450,10 @@ def __str__(self) -> str: # pragma: no cover
450450 def _add_operation_from_route_function (self , route_function : RouteFunction ) -> None :
451451 # converts route functions to Operation model
452452 if route_function .route .route_params .operation_id is None :
453- route_function .route .route_params .operation_id = f"{ str (uuid .uuid4 ())[:8 ]} _controller_{ route_function .route .view_func .__name__ } "
453+ controller_name = (
454+ str (self .controller_class .__name__ ).lower ().replace ("controller" , "" )
455+ )
456+ route_function .route .route_params .operation_id = f"{ controller_name } _{ route_function .route .view_func .__name__ } _{ str (uuid .uuid4 ())[:8 ]} "
454457
455458 if (
456459 self .auth
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ def _register_create_endpoint(self) -> None:
6868
6969 def _register_update_endpoint (self ) -> None :
7070 _path = "/{%s:%s}" % (
71- self ._pk_type .__name__ ,
71+ self ._pk_type .__name__ . lower () ,
7272 self ._model_pk_name ,
7373 )
7474 kw = {
@@ -91,7 +91,7 @@ def _register_update_endpoint(self) -> None:
9191 def _register_patch_endpoint (self ) -> None :
9292 _pk_type = self ._pk_type
9393 _path = "/{%s:%s}" % (
94- _pk_type .__name__ ,
94+ _pk_type .__name__ . lower () ,
9595 self ._model_pk_name ,
9696 )
9797
@@ -114,7 +114,7 @@ def _register_patch_endpoint(self) -> None:
114114
115115 def _register_find_one_endpoint (self ) -> None :
116116 _path = "/{%s:%s}" % (
117- self ._pk_type .__name__ ,
117+ self ._pk_type .__name__ . lower () ,
118118 self ._model_pk_name ,
119119 )
120120 kw = {
@@ -163,7 +163,7 @@ def _register_list_endpoint(self) -> None:
163163
164164 def _register_delete_endpoint (self ) -> None :
165165 _path = "/{%s:%s}" % (
166- self ._pk_type .__name__ ,
166+ self ._pk_type .__name__ . lower () ,
167167 self ._model_pk_name ,
168168 )
169169 kw = {
You can’t perform that action at this time.
0 commit comments