Skip to content

Commit 1cecda4

Browse files
use fastapi_i18n dependency on all endpoints
1 parent 8fe20b4 commit 1cecda4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ohsome_quality_api/api/api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import os
44
from typing import Any, Union
55

6-
from fastapi import FastAPI, HTTPException, Request, status
6+
from fastapi import Depends, FastAPI, HTTPException, Request, status
77
from fastapi.encoders import jsonable_encoder
88
from fastapi.exceptions import RequestValidationError
99
from fastapi.middleware.cors import CORSMiddleware
@@ -13,6 +13,7 @@
1313
get_swagger_ui_oauth2_redirect_html,
1414
)
1515
from fastapi.responses import JSONResponse
16+
from fastapi_i18n import i18n
1617
from geojson import FeatureCollection
1718
from starlette.exceptions import HTTPException as StarletteHTTPException
1819
from starlette.staticfiles import StaticFiles
@@ -114,6 +115,7 @@
114115
openapi_tags=TAGS_METADATA,
115116
docs_url=None,
116117
redoc_url=None,
118+
dependencies=[Depends(i18n)],
117119
)
118120

119121
app.add_middleware(

0 commit comments

Comments
 (0)