singleton icon indicating copy to clipboard operation
singleton copied to clipboard

[BUG] [Java Service] \ in standard ascii but collect source failed when key contain "\" in POST&GET api both in V1&V2

Open JiLiang888 opened this issue 2 years ago • 5 comments

Describe the bug \ in standard ascii but collect source failed when key contain "" in POST api both in V1&V2

To Reproduce 1.use post api http://localhost:8091/i18n/api/v2/translation/products/test/versions/1.1.0/locales/en-US/components/0728post/keys/%23%2412%3Caa11%3E%3D%27%27%40%3B%5BAWE%7D~xyT%5E.%22df1%27-%3F%2B23-a%2A9%26%25%23%21%2C%2Fand?collectSource=true

image

image

  1. request key = \ or double \

  2. response error ,can see picture

Expected behavior request key = \ or double \

the key also can be collected .details can see below picture : image

Screenshots image

commit 93ffa26a7c0616ff7fee3eb25318342d1dc8975b

JiLiang888 avatar Jul 28 '22 09:07 JiLiang888

Same issue in V1 GET key-based APIs: Failed to collect or get the translation of key name with "\". image

V2 GET key API: Failed to collect or get the translation of key name with "\". image

lyiyu66 avatar Aug 02 '22 00:08 lyiyu66

The issue is reproducible on l10n APIs: V1: GET /l10n/api/v1/source/products/{productName}/components/{component}/keys/{key} V2: POST /i18n​/l10n​/api​/v2​/translation​/products​/{productName}​/versions​/{version}​/locales​/{locale}​/components​/{component}​/keys​/{key}

lyiyu66 avatar Aug 03 '22 05:08 lyiyu66

this is swaggerui3's issue, it doesn't support the url encode, we need to wait the swaggers' upgrade to support url encoding feature. Please use Postman do testing, it will be work successfully.

tigershi avatar Aug 19 '22 02:08 tigershi

Tried with Postman, it still get same response.

lyiyu66 avatar Aug 25 '22 01:08 lyiyu66

test failed in 0826 image

JiLiang888 avatar Aug 26 '22 09:08 JiLiang888

The issue is fixed with commit 5ff0dfac9f918c4b230a25a209c3c1d0c34bb6ae, the regression bug is tracked with new bug https://github.com/vmware/singleton/issues/1871

lyiyu66 avatar Sep 06 '22 02:09 lyiyu66