Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.

Commit c47307d

Browse files
committed
review: simplify root router links
1 parent 34c248b commit c47307d

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/stapi_fastapi/routers/root_router.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,16 @@ def get_root(self, request: Request) -> RootResponse:
156156
rel="self",
157157
type=TYPE_JSON,
158158
),
159+
Link(
160+
href=str(request.url_for(self.openapi_endpoint_name)),
161+
rel="service-description",
162+
type=TYPE_JSON,
163+
),
164+
Link(
165+
href=str(request.url_for(self.docs_endpoint_name)),
166+
rel="service-docs",
167+
type="text/html",
168+
),
159169
Link(
160170
href=str(request.url_for(f"{self.name}:conformance")),
161171
rel="conformance",
@@ -171,21 +181,10 @@ def get_root(self, request: Request) -> RootResponse:
171181
rel="orders",
172182
type=TYPE_GEOJSON,
173183
),
174-
Link(
175-
href=str(request.url_for(self.openapi_endpoint_name)),
176-
rel="service-description",
177-
type=TYPE_JSON,
178-
),
179-
Link(
180-
href=str(request.url_for(self.docs_endpoint_name)),
181-
rel="service-docs",
182-
type="text/html",
183-
),
184184
]
185185

186186
if self.supports_async_opportunity_search:
187-
links.insert(
188-
-2,
187+
links.append(
189188
Link(
190189
href=str(
191190
request.url_for(f"{self.name}:list-opportunity-search-records")

0 commit comments

Comments
 (0)