Skip to content

Commit a513649

Browse files
committed
split common routes
1 parent dd44d6f commit a513649

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tipg/factory.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ def __post_init__(self):
219219
"""Post Init: register route and configure specific options."""
220220
self.register_routes()
221221
if self.with_common:
222-
self.register_common_routes()
222+
self._conformances_route()
223+
self._landing_route()
223224

224225
def url_for(self, request: Request, name: str, **path_params: Any) -> str:
225226
"""Return full url (with prefix) for a specific handler."""
@@ -269,8 +270,8 @@ def links(self, request: Request) -> List[model.Link]:
269270
"""Register factory Routes."""
270271
...
271272

272-
def register_common_routes(self):
273-
"""Register Landing (/) and Conformance (/conformance) routes."""
273+
def _conformance_route(self):
274+
"""Register Conformance (/conformance) route."""
274275

275276
@self.router.get(
276277
"/conformance",
@@ -303,6 +304,9 @@ def conformance(
303304

304305
return data
305306

307+
def _landing_route(self):
308+
"""Register Landing (/) and Conformance (/conformance) routes."""
309+
306310
@self.router.get(
307311
"/",
308312
response_model=model.Landing,

0 commit comments

Comments
 (0)