[BUG] [Singleton Service] Different response when pattern not exist due to different parameters in getPatternByLanguage&Region API
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 72
- Forks
- 69
- Avg merge
- 23h 32m
- Merged PRs (30d)
- 4
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing GET /i18n/api/v2/formatting/patterns with invalid language, region, and scope values as described. Trace the endpoint's parameter validation and response handling; done means unsupported values receive a consistent response code and distinct, appropriate messages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, localization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100