gnmic icon indicating copy to clipboard operation
gnmic copied to clipboard

Junk value displayed when char '>' is present in response value

Open Shikha-Chowdhary opened this issue 8 months ago • 2 comments

In the current scenario the exact value of parameter is "*> il", but '>' is displayed as \u003e in gnmic.

  • Value includes few special chars like *, >, and space char. Facing display issue with '>' only.

  • Is there any restriction at gnmic wrt the usage of special chars ?

  • This value is displayed correctly in a C++ based gRPC client.

    { "address": "1.2.3.4", "key1": "i", "key2": "Local", "key3": "*\u003e il", . . . }

Shikha-Chowdhary avatar Apr 30 '25 17:04 Shikha-Chowdhary

That is expected, it is Go's encoding/json package default behavior. It escapes >, < and & for security reasons.

You could convert back the unicode character before using the value or I can add a flag to disable escaping those chars. Which command and encoding do you see/need this ?

karimra avatar May 01 '25 17:05 karimra

Adding a flag would surely help

  • I observed this with GET & JSON+ASCII encoding.
  • Checking for subscribe too

Shikha-Chowdhary avatar May 01 '25 17:05 Shikha-Chowdhary