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
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.
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.
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
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: