singleton
singleton copied to clipboard
[BUG] [Singleton Service] Different response when pattern not exist due to different parameters in getPatternByLanguage&Region API
Describe the bug In API GET /i18n/api/v2/formatting/patterns, here is different response when no pattern data existing due to different parameters error.
To Reproduce Steps to reproduce the behavior:
- Start Singleton Service build
- Go to API GET /i18n/api/v2/formatting/patterns
- Input any invalid value for parameters: language/region/scope
- Return different response:
- When language is invalid Request value: language=abc, region=US, scope=plurals
{
"response": {
"code": 200,
"message": "OK",
"serverTime": ""
},
"signature": "",
"data": {
"localeID": "abc",
"language": "abc",
"region": "US",
"categories": {
"plurals": null,
"supplemental": {
"plurals": null
}
}
}
}
- When region is invalid Request value: language=en, region=AB, scope=dates
{
"response": {
"code": 404,
"message": "Not Found",
"serverTime": ""
},
"signature": "",
"data": "'No mapping language found for region!"
}
- When scope is not supported Request value: language=en, region=US, scope=other
{
"response": {
"code": 400,
"message": "Bad Request",
"serverTime": ""
},
"signature": "",
"data": "Parameter error"
}
Expected behavior It should have consistent response code, and different messages like: language/region/scope is not supported
Screenshots NA
Desktop (please complete the following information): NA
Additional context NA