title: Presenting missing values as null or not at all in JSON
body: <p>I am building a web service API, using JSON as the data language. Designing the structure of the data returned from the service, I am having some trouble deciding how to deal with missing values.</p>
  
  <p>Consider this example: I have a product in my web store for which the price is yet unknown, maybe because the product has not yet been released. Do I include <code>price: null</code> (as shown below) or do I simply omit the <code>price</code> property on this item?</p>
  
  <pre><code>{
      name: 'OSX 10.6.10',
      brand: 'Apple',
      price: null
  }
  </code></pre>
  
  <p>My main concern is making the API as easy to consume as possible. The explicit null value makes it clear that a <code>price</code> can be expected on a product, but at the other hand it seems like wasted bytes. There could be a whole bunch of properties that are completely irrelevant to this particular product, while relevant for other products – should I show these as explicitly <code>null</code> as well?</p>
  
  <pre><code>{
      name: 'OSX 10.6.10',
      price: 29.95,
      color: null,
      size: null
  }
  </code></pre>
  
  <p>Are there any "best practices" on web service design, favoring explicit or implicit null values? Any de-facto standard? Or does it depend entirely on the use case?</p>