<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent activity in data.json</title>
<link>https://ask.clojure.org/index.php/activity/contrib-libs/data-json</link>
<description>Powered by Question2Answer</description>
<item>
<title>Closed: An undocumented breaking change in data.json</title>
<link>https://ask.clojure.org/index.php/14728/an-undocumented-breaking-change-in-data-json?show=14728#q14728</link>
<description>&lt;p&gt;between the versions &lt;code&gt;1.1.0&lt;/code&gt; and &lt;code&gt;2.0.0&lt;/code&gt;, data.json introduced a breaking change: The &lt;code&gt;JSONWriter#-write&lt;/code&gt; signature changed from &lt;code&gt;[object out]&lt;/code&gt; to &lt;code&gt;[object out options]&lt;/code&gt;&lt;br&gt;
On this commit:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/data.json/commit/8f070ba94dc7c469f303259ce5f5bfa0b53d50bd&quot;&gt;https://github.com/clojure/data.json/commit/8f070ba94dc7c469f303259ce5f5bfa0b53d50bd&lt;/a&gt;&lt;br&gt;
In release notes &lt;code&gt;Release 2.0.0 on 2021-Mar-19 &lt;/code&gt;, there is no mention to &lt;code&gt;JSONWriter&lt;/code&gt; or &lt;code&gt;-write&lt;/code&gt; protocol changes.&lt;/p&gt;
&lt;p&gt;I know it&#039;s a very old problem, but I think this documentation could be present.&lt;/p&gt;
</description>
<category>data.json</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14728/an-undocumented-breaking-change-in-data-json?show=14728#q14728</guid>
<pubDate>Tue, 25 Nov 2025 20:33:50 +0000</pubDate>
</item>
<item>
<title>Answered: Accidental breaking change in data.json 2.5.0: previously, read succeeded, now it isn&#039;t</title>
<link>https://ask.clojure.org/index.php/14134/accidental-breaking-change-data-json-previously-succeeded?show=14272#a14272</link>
<description>&lt;p&gt;A PBR with buffer size &amp;gt;= 64 must be supplied if you intend to do repeated reads on the same string. The docstring to read has been further updated in 2.5.1 to include this.&lt;/p&gt;
</description>
<category>data.json</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14134/accidental-breaking-change-data-json-previously-succeeded?show=14272#a14272</guid>
<pubDate>Tue, 26 Nov 2024 19:44:16 +0000</pubDate>
</item>
<item>
<title>Comment edited: Add ability to preserve namespaces on `clojure.lang.Named` when using `clojure.data.json/write`</title>
<link>https://ask.clojure.org/index.php/12115/ability-preserve-namespaces-clojure-named-using-clojure-write?show=14101#c14101</link>
<description>I just hit the exact same issue.&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;m also worried about overriding the default behaviour, just in case some other lib (eg. Datomic Cloud) depends on it.&lt;br /&gt;
&lt;br /&gt;
I did try to override though, based on the default implementation and I haven&amp;#039;t experienced any issues so far:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(defn- write-named [x out options]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(json/-write (kw-&amp;gt;sym-&amp;gt;str x) out options))&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(extend clojure.lang.Named json/JSONWriter {:-write write-named})&lt;br /&gt;
&lt;br /&gt;
I thought, I would put this example here for people, who are less experienced with Clojure protocols.&lt;br /&gt;
I hope it&amp;#039;s the right approach :)</description>
<category>data.json</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12115/ability-preserve-namespaces-clojure-named-using-clojure-write?show=14101#c14101</guid>
<pubDate>Thu, 05 Sep 2024 08:58:24 +0000</pubDate>
</item>
<item>
<title>Answered: data.json :date-formatter does not support all the formats Cheshire :date-format does due to using Instant internally</title>
<link>https://ask.clojure.org/index.php/14049/formatter-support-formats-cheshire-format-instant-internally?show=14051#a14051</link>
<description>&lt;p&gt;Answer provided by @cddr on Slack:&lt;/p&gt;
&lt;p&gt;Use &lt;code&gt;.withZone&lt;/code&gt; on the &lt;code&gt;DateTimeFormatter&lt;/code&gt; itself to provide a timezone, and then the original format works just fine with &lt;code&gt;clojure.data.json&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{:date-formatter (-&amp;gt; (DateTimeFormatter/ofPattern &quot;MMMM, dd yyyy HH:mm:ss Z&quot;)
                     (DateTimeFormatter/.withZone ZoneOffset/UTC))}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(or &lt;code&gt;(ZoneId/systemDefault)&lt;/code&gt; or similar).&lt;/p&gt;
&lt;p&gt;This completely solves the problem, without changes to &lt;code&gt;clojure.data.json&lt;/code&gt;.&lt;/p&gt;
</description>
<category>data.json</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14049/formatter-support-formats-cheshire-format-instant-internally?show=14051#a14051</guid>
<pubDate>Sat, 10 Aug 2024 19:44:32 +0000</pubDate>
</item>
<item>
<title>Answer selected: Should clojure.data.json protect against duplicate keys when writing a combination of keyword and string keys?</title>
<link>https://ask.clojure.org/index.php/13589/clojure-protect-against-duplicate-writing-combination-keyword?show=13590#a13590</link>
<description>&lt;p&gt;All json keys are strings, so the default key-fn stringifies all key values. In general, most uses of the json write functions will be passing a map with either all keyword or all string keys - in those cases, it&#039;s not possible for any duplicate key to occur.&lt;/p&gt;
&lt;p&gt;While it would be possible to transform the keys and/or track written keys, either of these approaches are expensive to perform given that they are usually not needed. Thus, you should ensure the stringified keys of your objects are unique prior to calling write, if there is some chance of duplication.&lt;/p&gt;
</description>
<category>data.json</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13589/clojure-protect-against-duplicate-writing-combination-keyword?show=13590#a13590</guid>
<pubDate>Wed, 03 Jan 2024 06:54:04 +0000</pubDate>
</item>
<item>
<title>Commented: Fast way to print indented json</title>
<link>https://ask.clojure.org/index.php/7060/fast-way-to-print-indented-json?show=13515#c13515</link>
<description>Thanks, fixed.</description>
<category>data.json</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/7060/fast-way-to-print-indented-json?show=13515#c13515</guid>
<pubDate>Sat, 02 Dec 2023 17:09:05 +0000</pubDate>
</item>
<item>
<title>Answer selected: Improve exception message for input with bytes in (range 32)</title>
<link>https://ask.clojure.org/index.php/11561/improve-exception-message-for-input-with-bytes-in-range-32?show=11562#a11562</link>
<description>&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/DJSON-56&quot;&gt;https://clojure.atlassian.net/browse/DJSON-56&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Importantly, we need to check this doesn&#039;t hurt performance.&lt;/p&gt;
</description>
<category>data.json</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11561/improve-exception-message-for-input-with-bytes-in-range-32?show=11562#a11562</guid>
<pubDate>Fri, 11 Feb 2022 21:07:22 +0000</pubDate>
</item>
<item>
<title>Answer selected: Handle end-of-file in object and array readers</title>
<link>https://ask.clojure.org/index.php/11563/handle-end-of-file-in-object-and-array-readers?show=11572#a11572</link>
<description>&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/DJSON-57&quot;&gt;https://clojure.atlassian.net/browse/DJSON-57&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Note, need to consider perf impacts. It will be preferable to move the exception construction into a separate function to reduce bytecode size and make this more amenable to inlining.&lt;/p&gt;
</description>
<category>data.json</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11563/handle-end-of-file-in-object-and-array-readers?show=11572#a11572</guid>
<pubDate>Fri, 11 Feb 2022 21:06:15 +0000</pubDate>
</item>
<item>
<title>Commented: Improper parsing of literals</title>
<link>https://ask.clojure.org/index.php/7059/improper-parsing-of-literals?show=11571#c11571</link>
<description>I think we left that open as we&amp;#039;re still deciding what to do about the broader question of &amp;quot;parse whole input&amp;quot; vs &amp;quot;parse json values from streams&amp;quot;.</description>
<category>data.json</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/7059/improper-parsing-of-literals?show=11571#c11571</guid>
<pubDate>Fri, 11 Feb 2022 20:18:31 +0000</pubDate>
</item>
<item>
<title>Answered: Custom fallback function</title>
<link>https://ask.clojure.org/index.php/11071/custom-fallback-function?show=11099#a11099</link>
<description>&lt;p&gt;Logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/DJSON-54&quot;&gt;https://clojure.atlassian.net/browse/DJSON-54&lt;/a&gt; &lt;/p&gt;
</description>
<category>data.json</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11071/custom-fallback-function?show=11099#a11099</guid>
<pubDate>Fri, 24 Sep 2021 17:28:39 +0000</pubDate>
</item>
<item>
<title>Commented: Pushback buffer overflow reading large json file with clojure.data.json 2.1.0</title>
<link>https://ask.clojure.org/index.php/10443/pushback-buffer-overflow-reading-large-json-file-with-clojure?show=10447#c10447</link>
<description>I&amp;#039;m not blocked on anything since version 1.0.0 works great for me. I just noticed it when I was upgrading a bunch of dependencies.&lt;br /&gt;
&lt;br /&gt;
Thanks for the quick response!</description>
<category>data.json</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10443/pushback-buffer-overflow-reading-large-json-file-with-clojure?show=10447#c10447</guid>
<pubDate>Fri, 09 Apr 2021 22:01:30 +0000</pubDate>
</item>
<item>
<title>Commented: json writer and namespaces</title>
<link>https://ask.clojure.org/index.php/9758/json-writer-and-namespaces?show=9767#c9767</link>
<description>`{&amp;quot;a&amp;quot; &amp;quot;str&amp;quot; (symbol &amp;quot;a&amp;quot;) &amp;quot;sym&amp;quot; :a &amp;quot;kw&amp;quot;}` will produce `{&amp;quot;a&amp;quot;: &amp;quot;str&amp;quot;, &amp;quot;a&amp;quot;: &amp;quot;sym&amp;quot;, &amp;quot;a&amp;quot;, &amp;quot;kw&amp;quot;}` using your &amp;quot;correct&amp;quot; solution.&lt;br /&gt;
&lt;br /&gt;
Duped keys is not invalid JSON. On most browser impls, &amp;quot;the last one&amp;quot; will be the &amp;quot;real one&amp;quot;&lt;br /&gt;
&lt;a href=&quot;https://stackoverflow.com/questions/21832701/does-json-syntax-allow-duplicate-keys-in-an-object&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://stackoverflow.com/questions/21832701/does-json-syntax-allow-duplicate-keys-in-an-object&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Personally, I map manually every qualified field into a unqualified, to generate JSON</description>
<category>data.json</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9758/json-writer-and-namespaces?show=9767#c9767</guid>
<pubDate>Mon, 09 Nov 2020 14:04:53 +0000</pubDate>
</item>
<item>
<title>Answer selected: Is the standard JSON parser broken ?</title>
<link>https://ask.clojure.org/index.php/8860/is-the-standard-json-parser-broken?show=8862#a8862</link>
<description>&lt;p&gt;This has been logged as &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/DJSON-29&quot;&gt;https://clojure.atlassian.net/browse/DJSON-29&lt;/a&gt; and fixed and a new version org.clojure/data.json 0.2.7 with the fix is available.&lt;/p&gt;
</description>
<category>data.json</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8860/is-the-standard-json-parser-broken?show=8862#a8862</guid>
<pubDate>Tue, 19 Nov 2019 05:28:03 +0000</pubDate>
</item>
<item>
<title>Answered: Separator punctuation is treated as whitespace in arrays and objects</title>
<link>https://ask.clojure.org/index.php/7066/separator-punctuation-treated-whitespace-arrays-objects?show=7078#a7078</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/DJSON-27&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/DJSON-27&lt;/a&gt; (reported by alex+import)</description>
<category>data.json</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/7066/separator-punctuation-treated-whitespace-arrays-objects?show=7078#a7078</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Escape control characters 0-1F even if :escape-unicode false</title>
<link>https://ask.clojure.org/index.php/7065/escape-control-characters-0-1f-even-if-escape-unicode-false?show=7077#a7077</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/DJSON-28&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/DJSON-28&lt;/a&gt; (reported by alex+import)</description>
<category>data.json</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/7065/escape-control-characters-0-1f-even-if-escape-unicode-false?show=7077#a7077</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: clojure.json.data should handle non breking whitespace</title>
<link>https://ask.clojure.org/index.php/7064/clojure-json-data-should-handle-non-breking-whitespace?show=7075#a7075</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/DJSON-24&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/DJSON-24&lt;/a&gt; (reported by alex+import)</description>
<category>data.json</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/7064/clojure-json-data-should-handle-non-breking-whitespace?show=7075#a7075</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: write-object can retain head of collections</title>
<link>https://ask.clojure.org/index.php/7063/write-object-can-retain-head-of-collections?show=7074#a7074</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/DJSON-26&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/DJSON-26&lt;/a&gt; (reported by alex+import)</description>
<category>data.json</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/7063/write-object-can-retain-head-of-collections?show=7074#a7074</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Escaped backslash in strings throws</title>
<link>https://ask.clojure.org/index.php/7062/escaped-backslash-in-strings-throws?show=7072#a7072</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/DJSON-25&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/DJSON-25&lt;/a&gt; (reported by vitoshka)</description>
<category>data.json</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/7062/escaped-backslash-in-strings-throws?show=7072#a7072</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
<item>
<title>Answered: Improper parsing of numbers - leading zeroes should be disallowed</title>
<link>https://ask.clojure.org/index.php/7061/improper-parsing-numbers-leading-zeroes-should-disallowed?show=7070#a7070</link>
<description>Reference: &lt;a href=&quot;https://clojure.atlassian.net/browse/DJSON-22&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://clojure.atlassian.net/browse/DJSON-22&lt;/a&gt; (reported by alex+import)</description>
<category>data.json</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/7061/improper-parsing-numbers-leading-zeroes-should-disallowed?show=7070#a7070</guid>
<pubDate>Wed, 26 Jun 2019 12:00:00 +0000</pubDate>
</item>
</channel>
</rss>