Steps to replicate the issue (include links if applicable):
- Make a request to the legacy endpoint with invalid start and end date formats
What happens?:
- Only the start time warning is displayed
What should have happened instead?:
- start time and end warning should be displayed at the same time
Software version (skip for WMF-hosted wikis like Wikipedia):
legacy AQS service
Other information (browser name/version, screenshots, etc.):
Code used for Prod:
Request
import requests
prod_url = 'https://wikimedia.org/api/rest_v1/metrics/legacy/pagecounts/aggregate/en.wikipedia.org/all-sites/daily/20140101/20140101'
header = {"accept": "application/json",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36"}
response = requests.get(prod_url, headers=header)
print(response.status_code)
print(response.json())Prod response:
{
"type":"https://mediawiki.org/wiki/HyperSwitch/errors/invalid_request",
"method":"get",
"detail":[
"start timestamp is invalid, must be a valid date in YYYYMMDDHH format",
"end timestamp is invalid, must be a valid date in YYYYMMDDHH format"
],
"uri":"/analytics.wikimedia.org/v1/legacy/pagecounts/aggregate/en.wikipedia.org/all-sites/daily/20140101/20140101"
}AQS 2.0 Response:
{
"detail":"start timestamp is invalid, must be a valid date in YYYYMMDDHH format",
"method":"get",
"status":400,
"title":"Bad Request",
"type":"about:blank",
"uri":"/metrics/legacy/pagecounts/aggregate/en.wikipedia.org/all-sites/daily/20140101/20140101"
}Its better to show the errors all at once just as it is shown in prod.