Hitting the /v0/solar/GB/gsp/forecast/all endpoint returns status 422 with pydantic error around 'all' not being an integer. Issue appears to be around the overlap between this endpoint and /v0/solar/GB/gsp/forecast/{gsp_id}
To Reproduce
Running
url = "https://api.quartz.solar/v0/solar/GB/gsp/forecast/all"
r = requests.get(url=url,headers={"Authorization": "Bearer "+access_token})
r.content
Returns a 422 status code with content:
{"detail":[{"type":"int_parsing","loc":["path","gsp_id"],"msg":"Input should be a valid integer, unable to parse string as an integer","input":"all"}]}
Expected behavior
Should receive 200 code with GSP latest forecasts
Additional context
I guess this may have something to do with the old forecast/{gsp_id} endpoint, which enforces type gsp_id: str and throws an error. See function below:
There could be a quick fix in redirecting to get_all_available_forecasts() if gsp_id=='all' but this seems janky. Plus they don't have the same parameters.
Also very possible (likely??) I am doing something wrong myself !
Thanks @pwdemars for reporting this. We can defiantly fix this.
In the mean time if you use
url = "https://api.quartz.solar/v0/solar/GB/gsp/forecast/all/" with a forward slack at the end it works ok.
Describe the bug
Hitting the
/v0/solar/GB/gsp/forecast/all
endpoint returns status 422 with pydantic error around 'all' not being an integer. Issue appears to be around the overlap between this endpoint and/v0/solar/GB/gsp/forecast/{gsp_id}
To Reproduce
Running
Returns a 422 status code with content:
Expected behavior
Should receive 200 code with GSP latest forecasts
Additional context
I guess this may have something to do with the old
forecast/{gsp_id}
endpoint, which enforces typegsp_id: str
and throws an error. See function below:There could be a quick fix in redirecting to
get_all_available_forecasts()
ifgsp_id=='all'
but this seems janky. Plus they don't have the same parameters.Also very possible (likely??) I am doing something wrong myself !