vmware / vmware/singleton

[BUG] [Singleton Service] Different response when pattern not exist due to different parameters in getPatternByLanguage&Region API

Open
#347 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/java-service kind/bug priority/low
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:

  1. Start Singleton Service build
  2. Go to API GET /i18n/api/v2/formatting/patterns
  3. Input any invalid value for parameters: language/region/scope
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.