title: http://www.jsonschemavalidator.net/ doesn't appear to honour "uniqueitems": true or "additionalProperties": false
body: <p>I've been reading up on how to define json schema to hold a list of different shaped objects: person, address, vehicle. Part of the research led me to posts where helpful additions were suggested. e.g. adding "uniqueitems": true so that the list doesn't contain duplicates.</p>
  
  <p>I've found the site <a href="http://www.jsonschemavalidator.net/" rel="nofollow noreferrer">http://www.jsonschemavalidator.net/</a> extremely useful in validating my schema and json data but I can't figure out what I'm doing wrong with both </p>
  
  <pre><code>"additionalProperties": false 
  </code></pre>
  
  <p>and</p>
  
  <pre><code>"uniqueitems": true
  </code></pre>
  
  <p>Here is my sample schema and data:</p>
  
  <pre><code>{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "an array of Insurable Items",
    "type": "array",
    "items": {
      "type": "object",
      "OneOf": [
        {
          "type": "object",
          "description": "A Person",
          "properties": {
            "person": {
              "type": "object",
              "$ref": "#/definitions/person"
            }
          },
          "required": [
            "person"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "description": "An Address",
          "properties": {
            "address": {
              "type": "object",
              "$ref": "#/definitions/address"
            }
          },
          "required": [
            "address"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "description": "A Vehicle",
          "properties": {
            "vehicle": {
              "type": "object",
              "$ref": "#/definitions/vehicle"
            }
          },
          "required": [
            "vehicle"
          ],
          "additionalProperties": false
        }
      ],
      "uniqueitems": true
    },
  
    "definitions": {
      "person": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "firstname": {
            "type": "string"
          },
          "lastname": {
            "type": "string"
          },
          "dateofbirth": {
            "type": "string"
          },
          "employmentstatus": {
            "type": "string"
          },
          "occupation": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "address": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "line1": {
            "type": "string"
          },
          "line2": {
            "type": "string"
          },
          "line3": {
            "type": "string"
          },
          "line4": {
            "type": "string"
          },
          "line5": {
            "type": "string"
          },
          "postcode": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "vehicle": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "vehiclecode": {
            "type": "string"
          },
          "registrationyear": {
            "type": "string"
          },
          "registrationletter": {
            "type": "string"
          },
          "registrationnumber": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    }
  }
  </code></pre>
  
  <p>Data:</p>
  
  <pre><code>[
    {
      "person": {
        "id": "123456789-01",
        "title": "Mr",
        "firstname": "Joe",
        "lastname": "blogs"
      },
      "badadditional": "thing"
    },
    {
      "address": {
        "id": "123456789-A",
        "line1": "1 The Mall",
        "line2": "Westminster",
        "line3": "London",
        "postcode": "SW1A 1AA"
      }
    },
    {
      "address": {
        "id": "123456789-A",
        "line1": "1 The Mall",
        "line2": "Westminster",
        "line3": "London",
        "postcode": "SW1A 1AA"
      }
    },
    {
      "vehicle": {
        "id": "123456789-01-01",
        "vehiclecode": "string",
        "registrationyear": "string",
        "registrationletter": "string",
        "registrationnumber": "string",
        "description": "string",
        "badadditional": "other thing"
      }
    }
  ]
  </code></pre>
  
  <p>If you copy these into the <a href="http://www.jsonschemavalidator.net/" rel="nofollow noreferrer">http://www.jsonschemavalidator.net/</a> schema validator, it reports no problem despite the presence of</p>
  
  <pre><code>"badadditional": "thing"
  </code></pre>
  
  <p>and</p>
  
  <pre><code>"badadditional": "other thing"
  </code></pre>
  
  <p>and the duplicate address object.</p>
  
  <p>I've been searching stackoverflow [tagged with json.net], reading (amongst others), <a href="http://grokbase.com" rel="nofollow noreferrer">http://grokbase.com</a>, <a href="http://json-schema.org" rel="nofollow noreferrer">http://json-schema.org</a> and I'm working to draft-04.</p>
  
  <p>I've also tried <a href="https://jsonschemalint.com/#/version/draft-04/markup/json" rel="nofollow noreferrer">https://jsonschemalint.com/#/version/draft-04/markup/json</a> but that also doesn't complain either.</p>
  
  <p>Can anyone point me towards other validators, json schema documentation and examples or let me know what I'm doing wrong if it's obvious?</p>