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

JSONParser is not handling escape char properly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • utils-1.9.0
    • utils-1.10.0
    • Utils
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: