vmware / singleton

A service that provides support for Software Internationalization and Localization
Other
68 stars 64 forks source link

[BUG][l10n]Return to 520 when collecting a key with empty source. #2690

Closed lyiyu66 closed 10 months ago

lyiyu66 commented 1 year ago

Describe the bug Return to 520 when collecting a key with empty source. API: POST[/l18n/l10n/api/v2/translation/products/{productName}/versions/{version}/locales/{locale}/components/{component}/keys/{key}

To Reproduce Steps to reproduce the behavior:

  1. Go to POST[/l18n/l10n/api/v2/translation/products/{productName}/versions/{version}/locales/{locale}/components/{component}/keys/{key}
  2. Leave the source body is empty and sourcCollect=true.
  3. Input other required parameters and submit.
  4. See error: return to code 520

Expected behavior Should return to 400 with message that we don't support the key with empty source.

lyiyu66 commented 10 months ago

The issue is fixed with commit: fdbda78bbec766dd65114f2cc6c3f42ae29d9fd6

{
    "code": 400,
    "message": "Don't support the key with NULL source",
    "serverTime": ""
}