Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-100

When rendering a partial markup response, Tapestry should quote attributes with single quotes (so that each quote doesn't have to be escaped in the JSON)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 5.0.15
    • 5.1.0.0
    • None
    • None

    Description

      When JSON output is sent to the client, it escapes each double quote with a backslash character.

      Most of the Tapestry code and typical markup uses double quotes, so there's a lot of characters to escape, which not only increases the size of the output, but makes it less readable.

      Example:

      {"script":"Tapestry.initializeZones([], [[\"form:11866b5b0ae\",\"output\"],[\"clear:11866b5b0ae\",\"output
      \"]]);Tapestry.registerValidation({\"password:11866b5b0ae\":[[\"required\",\"You must provide a value
      for Password.\"],[\"minlength\",\"You must provide at least 6 characters for Password.\",6]],\"birthYear
      :11866b5b0ae\":[[\"required\",\"You must provide a value for Birth Year.\"],[\"min\",\"Birth Year requires
      a value of at least 1900. \",1900],[\"max\",\"Birth Year requires a value no larger than 2007.\",2007
      ]],\"firstName:11866b5b0ae\":[[\"required\",\"You must provide a value for First Name.\"],[\"minlength
      \",\"You must provide at least 3 characters for First Name.\",3]],\"lastName:11866b5b0ae\":[[\"required

      Using single quotes around JSON Object keys and values would make this a lot more readable, as only the occasional single quote would need to be backslash escaped.

      Hm. The official JSON spec (http://www.json.org/) seems to indicate that strings must be quoted with double quotes.

      Attachments

        Activity

          People

            hlship Howard Lewis Ship
            hlship Howard Lewis Ship
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: