title: Is it possible to have an optional field in an Avro schema (i.e. the field does not appear at all in the .json file)?
body: <p>Is it possible to have an optional field in an Avro schema (i.e. the field does not appear at all in the .JSON file)?</p>
  
  <p>In my Avro schema, I have two fields:</p>
  
  <pre><code>{"name": "author", "type": ["null", "string"], "default": null},
  {"name": "importance", "type": ["null", "string"], "default": null},
  </code></pre>
  
  <p>And in my JSON files those two fields can exist or not.</p>
  
  <p>However, when they do not exist, I receive an error (e.g. when I test such a JSON file using avro-tools command line client):</p>
  
  <pre><code>Expected field name not found: author
  </code></pre>
  
  <p>I understand that as long as the <strong>field name</strong> exists in a JSON, it can be <code>null</code>, or a <code>string</code> value, but what I'm trying to express is something like "this JSON is valid if the those field names <strong>do not exist</strong>, OR if they exist and they are null or string".</p>
  
  <p>Is this possible to express in an Avro schema? If so, how?</p>