Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Json serialize. Double quotes in in a key produces invalid json

    Hello,
    I am trying to serialize following javascript object
    {
    key with " double quote: "value"
    }

    with $wnd.isc.JSON.encode(object) (I am using smartgwt but this is actually issue in smartclient)

    actual result is INVALID json string.
    {
    'key with " double quote': "value"
    }

    According json.org only double quotes are allowed to wrap a key. You are using apostrophe instead.

    Actually I have looked to smartclient sources (Serialize.js) you provide and I have found out you have a special case for such keys with quotes and it is resolved with apostrophes.

    So it is feature or bug ?

    If feature, what other smart-client api I should use ? My goal is to serialize object to string. This string is then processed by backend, that cries that incomming json string is invalid.


    Thanks in advance

    I am using smart client v110p_2016-04-27_LGPL
    Last edited by petercipov; 25 May 2016, 06:21.

    #2
    It is a bug, has just been fixed - you can test it out in nightly builds dated May 27 and later.

    Comment

    Working...
    X