title: AJV optional date property but use ajv-format?
body: <p>I'm using AJV to validate some data before inserting it into a mongo database. I have an optional date field and am using ajv-formats to validate that date. This date, however, is optional and I only want to validate its format if its been provided. How would I go about this? Is the only option to add my own format regex that allows empty strings?</p>
  <pre><code>const properties = {
    date_leave: { 
      type: ['string', 'null'], 
      format: 'date' 
    },
  };
  </code></pre>
  <p>How I currently have this setup, it turns the date into basically a required field.</p>
  <p>I find myself running into this issue a lot as my application allows most fields to be optional to be saved as a draft. Is there a way to make an optional keyword that allows for null or empty strings automatically?</p>