Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-5555

JSONParser is not handling escape char properly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: utils-1.9.0
    • Fix Version/s: utils-1.10.0
    • Component/s: Utils
    • Labels:
      None

      Description

      JSONWriter currently adds an escape char for '/'. So "foo=/bar" is rendered as

      {"foo":"\/bar"}
      

      When such a json is read via JSONParser then the '\' is not removed

      Following test fails

          @Test
          public void escapeChar() throws Exception{
              StringWriter sw = new StringWriter();
              JSONWriter js = new JSONWriter(sw);
              js.object().key("foo").value("/bar").endObject().flush();
              
              JSONParser jp = new JSONParser(sw.toString());
              assertEquals("/bar", jp.getParsed().get("foo"));
          }
      

        Attachments

          Activity

            People

            • Assignee:
              bosschaert David Bosschaert
              Reporter:
              chetanm Chetan Mehrotra
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: