Skip to content

Commit

Permalink
Refactor lang to lang_code for api consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Apr 9, 2024
1 parent bea5666 commit 62beb60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions neon_hana/app/routers/api_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

@proxy_route.post("/weather")
async def api_proxy_weather(query: WeatherAPIRequest) -> WeatherAPIOnecallResponse:
query["lang"] = query.pop("lang_code")
return mq_connector.query_api_proxy("open_weather_map", dict(query))


Expand Down
5 changes: 3 additions & 2 deletions neon_hana/schema/api_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,20 @@ class WeatherAPIRequest(BaseModel):
lat: float
lon: float
unit: str = "metric"

lang_code: str = "en"
model_config = {
"json_schema_extra": {
"examples": [{
"api": "onecall",
"lat": 47.6815,
"lon": -122.2087,
"unit": "imperial",
"lang_code": "en"
}, {
"api": "onecall",
"lat": 47.6815,
"lon": -122.2087,
"unit": "metric",
"unit": "metric"
}]}}


Expand Down

0 comments on commit 62beb60

Please sign in to comment.