<div dir="ltr">This formatting of JSON isn&#39;t unheard of though, it&#39;s typically called JSON Streaming[1]. As long as exchanges implementing the API actually follow the BIP and keep one JSON object per line, it shouldn&#39;t be a problem to decode.<div><br></div><div>1. <a href="https://en.wikipedia.org/wiki/JSON_Streaming">https://en.wikipedia.org/wiki/JSON_Streaming</a></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Mar 7, 2017 at 8:07 AM Marcel Jamin via bitcoin-dev &lt;<a href="mailto:bitcoin-dev@lists.linuxfoundation.org">bitcoin-dev@lists.linuxfoundation.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">&gt; Why are multiple results separated by a line-feed rather than using a JSON Array?<br class="gmail_msg">
&gt; * Clients ought to cache historical data, and using a line-feed format allows them to simply append to a cache file.<br class="gmail_msg">
&gt; * Parsing JSON typically requires the entire data parsed together as a single memory object. Using simple lines to separate results, however, allows parsing a single result at a time.<br class="gmail_msg">
&gt; What if long descriptions require line and paragraph breaks?<br class="gmail_msg">
&gt; * Clients should word-wrap long lines, and JSON escapes newlines as &quot;\n&quot; which can be used doubly (&quot;\n\n&quot;) for paragraph breaks.<br class="gmail_msg">
<br class="gmail_msg">
I&#39;d file this under premature optimization at the cost of<br class="gmail_msg">
interoperability. If you use JSON, then please use it properly.<br class="gmail_msg">
<br class="gmail_msg">
I&#39;d also say it&#39;s the job of the parser to offer a way of doing that,<br class="gmail_msg">
e.g. in .NET you can easily achieve that with Newtonsoft&#39;s JSON<br class="gmail_msg">
parser: <a href="http://stackoverflow.com/questions/20374083/deserialize-json-array-stream-one-item-at-a-time" rel="noreferrer" class="gmail_msg" target="_blank">http://stackoverflow.com/questions/20374083/deserialize-json-array-stream-one-item-at-a-time</a>.<br class="gmail_msg">
<br class="gmail_msg">
On 4 March 2017 at 09:27, Luke Dashjr via bitcoin-dev<br class="gmail_msg">
&lt;<a href="mailto:bitcoin-dev@lists.linuxfoundation.org" class="gmail_msg" target="_blank">bitcoin-dev@lists.linuxfoundation.org</a>&gt; wrote:<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; Investigating what it would take to add fiat currency information to Bitcoin<br class="gmail_msg">
&gt; Knots, I noticed Electrum currently has many implementations, one for each<br class="gmail_msg">
&gt; exchange rate provider, due to lack of a common format for such data.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; Therefore, I put together an initial draft of a BIP that could standardise<br class="gmail_msg">
&gt; this so wallets (or other software) and exchange rate providers can simply<br class="gmail_msg">
&gt; interoperate without a lot of overhead reimplementing the same thing many<br class="gmail_msg">
&gt; ways.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; One thing I am unsure about, is that currently this draft requires using XBT<br class="gmail_msg">
&gt; (as BTC) for Bitcoin amounts. It would seem nicer to use satoshis, but those<br class="gmail_msg">
&gt; don&#39;t really have a pseudo-ISO currency code to fit in nicely...<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; Current draft here:<br class="gmail_msg">
&gt;     <a href="https://github.com/luke-jr/bips/blob/bip-xchgrate/bip-xchgrate.mediawiki" rel="noreferrer" class="gmail_msg" target="_blank">https://github.com/luke-jr/bips/blob/bip-xchgrate/bip-xchgrate.mediawiki</a><br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; Thoughts? Anything critical missing? Ways to make the interface better?<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; Luke<br class="gmail_msg">
&gt; _______________________________________________<br class="gmail_msg">
&gt; bitcoin-dev mailing list<br class="gmail_msg">
&gt; <a href="mailto:bitcoin-dev@lists.linuxfoundation.org" class="gmail_msg" target="_blank">bitcoin-dev@lists.linuxfoundation.org</a><br class="gmail_msg">
&gt; <a href="https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev</a><br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
bitcoin-dev mailing list<br class="gmail_msg">
<a href="mailto:bitcoin-dev@lists.linuxfoundation.org" class="gmail_msg" target="_blank">bitcoin-dev@lists.linuxfoundation.org</a><br class="gmail_msg">
<a href="https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev</a><br class="gmail_msg">
</blockquote></div>