Clojure-Contrib

c.c.json/json-str handles maps with keys containing quotes incorrectly

Details

  • Type: Defect Defect
  • Status: Resolved Resolved
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code and Test

Description

Consider:

> (println (json-str {"\"" 1})) 
{""":1} 
</code></pre>

...while I (and my parsers) would expect <pre><code>{"\"":1}
.

This happens in both contrib 1.2.0 and 1.3-alpha1.

Activity

Hide
Assembla Importer added a comment -
Show
Assembla Importer added a comment - Converted from http://www.assembla.com/spaces/clojure/tickets/98
Jan Rychter made changes -
Field Original Value New Value
Assignee Jan Rychter [ jwr ]
Hide
Jan Rychter added a comment -

The enclosed patch escapes object keys. It passes all tests. I've added a test that fails without the fix and passes with it.

Show
Jan Rychter added a comment - The enclosed patch escapes object keys. It passes all tests. I've added a test that fails without the fix and passes with it.
Jan Rychter made changes -
Attachment clojure-contrib-json-98.patch [ 10004 ]
Jan Rychter made changes -
Status Open [ 1 ] Resolved [ 5 ]
Resolution Completed [ 1 ]
Patch Code and Test
Hide
Jan Rychter added a comment -

I've been told that issues are marked as "resolved" only after the patch gets applied. I'm reopening the issue, then, hoping that someone will pick it up from here.

Show
Jan Rychter added a comment - I've been told that issues are marked as "resolved" only after the patch gets applied. I'm reopening the issue, then, hoping that someone will pick it up from here.
Jan Rychter made changes -
Resolution Completed [ 1 ]
Status Resolved [ 5 ] Reopened [ 4 ]
Assignee Jan Rychter [ jwr ]
Stuart Sierra made changes -
Assignee Stuart Sierra [ stuart.sierra ]
Stuart Sierra made changes -
Status Reopened [ 4 ] In Progress [ 3 ]
Stuart Sierra made changes -
Status In Progress [ 3 ] Open [ 1 ]
Hide
Stuart Sierra added a comment -

Patch does not apply, appears to be formatted for contrib pre-modularization.

Show
Stuart Sierra added a comment - Patch does not apply, appears to be formatted for contrib pre-modularization.
Hide
Stuart Sierra added a comment -

Rewrote patch to work with modularized contrib; applied in d6f6ccfaeac03e35b1f9dbfa04424866cd9b2a41

Show
Stuart Sierra added a comment - Rewrote patch to work with modularized contrib; applied in d6f6ccfaeac03e35b1f9dbfa04424866cd9b2a41
Stuart Sierra made changes -
Status Open [ 1 ] Resolved [ 5 ]
Resolution Completed [ 1 ]
Hide
Daniel Janus added a comment -

Is this going to be backported to 1.2 branch? It would be greatly appreciated.

Show
Daniel Janus added a comment - Is this going to be backported to 1.2 branch? It would be greatly appreciated.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: