title: How to format JSON schema for validation
body: <p>I am writing a program with Python/Flask and am using a package called flask-jsonschema-validator for JSON validation. When I validate my JSON I get the following error:</p>
  
  <pre><code>jsonschema.exceptions.SchemaError: [{'fieldname': {'type': 'string'}, 'type': {'type': 'string'}, 'description': {'type': 'string'}, 'default-value': {'type': 'string'}, 'validation': [{'type': 'string'}]}, {'fieldname': {'type': 'string'}, 'type': {'type': 'string'}, 'description': {'type': 'string'}, 'default-value': {'type': 'string'}, 'validation': [{'valid-values': {'type': 'string'}}, {'invalid-values': {'type': 'string'}}, {'isinteger': {'type': 'string'}}, {'nullable': {'type': 'string'}}]}] is not of type 'object', 'boolean'
  </code></pre>
  
  <p>Here is the JSON schema I am using</p>
  
  <pre><code>    {
      "validate": {
        "type": "object",
        "properties": {    
          "_id": { "type": "string", "minLength": 2, "maxLength": 100 },
          "name": { "type": "string", "minLength": 2, "maxLength": 100 },
          "type": { "type": "string", "minLength": 2, "maxLength": 100 },
          "subtype": { "type": "string", "minLength": 2, "maxLength": 100 },
          "domain-data-version": {"type": "string"},
          "description": { "type": "string", "minLength": 2, "maxLength": 100 },
          "created" : {"type": "string"},
          "owner-org": {"type": "string"},
          "domain-data":[
            {
             "fieldname": {"type": "string"},
              "type": {"type": "string"},
              "description": {"type": "string"},
              "default-value": {"type": "string"},
              "validation": [{"type": "string"}]},
            {"fieldname": {"type": "string"},
              "type": {"type": "string"},
              "description": {"type": "string"},
              "default-value": {"type": "string"},
              "validation": [ {"valid-values": {"type": "string"}},
                              {"invalid-values": {"type": "string"}},
                              {"isinteger": {"type": "string"}},
                              {"nullable": {"type": "string"}}]
                        }]
        },
        "required": []
      }
    }
  </code></pre>
  
  <p>Here is the JSON I would use to validate</p>
  
  <pre><code>{"name": "PHARMACY-CLAIM", "type": "Pharmacy", "subtype": "Prescription Filled", "domain-data-version": "1", "domain-data": [{"fieldname": "claim-id", "type": "string", "description": "The Insurance claim ID", "default-value": "null", "validation": [{"nullable": "false"}]}, {"fieldname": "member-gen-key", "type": "string", "description": "The unique insurance Member ID", "default-value": "null", "validation": [{"nullable": "false"}]}, {"fieldname": "ndc", "type": "string", "description": "The National Drug Code value for the medication prescription filled.", "default-value": "null", "validation": [{"nullable": "false"}]}]}
  </code></pre>
  
  <p>When I remove the "domain-data portion of the schema, the JSON will validate. I think the problem comes from the fact the domian-data is an array of objects but I am not sure what to do about it. Thanks for the help.</p>