Note that there are some explanatory texts on larger screens.

plurals
  1. POJSON and Microformats
    text
    copied!<p>I'm looking for opinions on whether microformats should be used to name JSON elements. For instance, there is a <a href="http://microformats.org/wiki/adr" rel="nofollow noreferrer">microformat for physical addresses</a>, that looks like this:</p> <pre><code>&lt;div class="adr"&gt; &lt;div class="street-address"&gt;665 3rd St.&lt;/div&gt; &lt;div class="extended-address"&gt;Suite 207&lt;/div&gt; &lt;span class="locality"&gt;San Francisco&lt;/span&gt;, &lt;span class="region"&gt;CA&lt;/span&gt; &lt;span class="postal-code"&gt;94107&lt;/span&gt; &lt;div class="country-name"&gt;U.S.A.&lt;/div&gt; &lt;/div&gt; </code></pre> <p>There is a document available on using <a href="http://microformats.org/wiki/json" rel="nofollow noreferrer">JSON and Microformats</a>. The information above could be represented as JSON data like this:</p> <pre><code>"adr": { "street-address":"665 3rd St.", "extended-address":"Suite 207", "locality":"San Fransicso", "region":"CA", "postal-code":"94107", "country-name":"U.S.A." }, </code></pre> <p>The issue I have with this is that I'd like my JSON data to be as lightweight as possible, but still human readable. While still supporting international addresses, I would prefer something like this:</p> <pre><code>"address": { "street":"665 3rd St.", "extended":"Suite 207", "locality":"San Fransicso", "region":"CA", "code":"94107", "country":"U.S.A." }, </code></pre> <p>If I'm designing a new JSON API right now, does it make sense to use microformats from the start? Or should I not really worry about it? Is there some other standard that is more specific to JSON that I should look at?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload