[ 
https://issues.apache.org/jira/browse/TAPESTRY-2211?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship updated TAPESTRY-2211:
-------------------------------------------

    Summary: 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)  (was: JSONObject should render useing single quotes so that double 
quotes don't have to be escaped)

JSON spec is very clear that attributes are quoted using double quotes.

Tapestry could adapt and use single quotes for attributes; this would simplify 
the markup in the JSON response, and reduce its overall size.

> 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)
> ---------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-2211
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2211
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.10
>            Reporter: Howard M. Lewis Ship
>            Priority: Minor
>             Fix For: 5.1
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to