title: Optional object with required fields in react-jsonschema-form
body: <p>Given a json schema like the one below, the react-jsonschema-form validator essentially requires both <code>shipping_address</code> and <code>billing_address</code> even though the <code>billing_address</code> is not listed as required. This is because the <code>address</code> type requires all three of its properties. How can I make the <code>billing_address</code> optional? It seems that react-jsonschema-form should simply no submit <code>billing_address</code> if not all of its <code>address</code> properties are filled in. Here is a <a href="https://mozilla-services.github.io/react-jsonschema-form/#eyJmb3JtRGF0YSI6eyJiaWxsaW5nX2FkZHJlc3MiOnsic3RyZWV0X2FkZHJlc3MiOiIyMSwgSnVtcCBTdHJlZXQiLCJjaXR5IjoiQmFiZWwiLCJzdGF0ZSI6Ik5ldmVybGFuZCJ9LCJzaGlwcGluZ19hZGRyZXNzIjp7fSwidHJlZSI6eyJuYW1lIjoicm9vdCIsImNoaWxkcmVuIjpbeyJuYW1lIjoibGVhZiJ9XX19LCJzY2hlbWEiOnsiZGVmaW5pdGlvbnMiOnsiYWRkcmVzcyI6eyJ0eXBlIjoib2JqZWN0IiwicHJvcGVydGllcyI6eyJzdHJlZXRfYWRkcmVzcyI6eyJ0eXBlIjoic3RyaW5nIn0sImNpdHkiOnsidHlwZSI6InN0cmluZyJ9LCJzdGF0ZSI6eyJ0eXBlIjoic3RyaW5nIn19LCJyZXF1aXJlZCI6WyJzdHJlZXRfYWRkcmVzcyIsImNpdHkiLCJzdGF0ZSJdfX0sInR5cGUiOiJvYmplY3QiLCJwcm9wZXJ0aWVzIjp7ImJpbGxpbmdfYWRkcmVzcyI6eyJ0aXRsZSI6IkJpbGxpbmcgYWRkcmVzcyIsIiRyZWYiOiIjL2RlZmluaXRpb25zL2FkZHJlc3MifSwic2hpcHBpbmdfYWRkcmVzcyI6eyJ0aXRsZSI6IlNoaXBwaW5nIGFkZHJlc3MiLCIkcmVmIjoiIy9kZWZpbml0aW9ucy9hZGRyZXNzIn19LCJyZXF1aXJlZCI6WyJiaWxsaW5nX2FkZHJlc3MiXX0sInVpU2NoZW1hIjp7InVpOm9yZGVyIjpbInNoaXBwaW5nX2FkZHJlc3MiLCJiaWxsaW5nX2FkZHJlc3MiXX19" rel="nofollow noreferrer">link</a> to the react-jsonschema-form playground.</p>
  
  <pre><code>{
    "definitions": {
      "address": {
        "type": "object",
        "properties": {
          "street_address": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string"
          }
        },
        "required": [
          "street_address",
          "city",
          "state"
        ]
      }
    },
    "type": "object",
    "properties": {
      "billing_address": {
        "title": "Billing address",
        "$ref": "#/definitions/address"
      },
      "shipping_address": {
        "title": "Shipping address",
        "$ref": "#/definitions/address"
      }
    },
    "required": [
      "shipping_address"
    ]
  }
  </code></pre>