title: jsonschema.exceptions.ValidationError: 'os-fault.json' is not of type 'object'
body: <p>I want to create JSON file the schema is 'http://json-schema.org/draft-04/schema#'.
  This is JSON file that I write.</p>
  <pre><code>{
      &quot;cloud_management&quot; : {
          &quot;driver&quot;: &quot;universal&quot;
      },
      &quot;node_discover&quot;: {
          &quot;driver&quot;: &quot;node_list&quot;,
          &quot;args&quot;: [
              {
                  &quot;ip&quot;: &quot;{my_ip}&quot;,
                  &quot;auth&quot;: {
                      &quot;username&quot;: &quot;{my_username}&quot;
                  }
              },
              {
                  &quot;ip&quot;: &quot;{my_2nd_ip}&quot;,
                  &quot;auth&quot;: {
                      &quot;username&quot;: &quot;{my_username}&quot;
                  }
              }
          ]
      },
      &quot;services&quot;: {
          &quot;memcached&quot;: {
              &quot;driver&quot;: &quot;system_service&quot;,
              &quot;args&quot;: {
                  &quot;service_name&quot;: &quot;memcached&quot;,
                  &quot;grep&quot;: &quot;memcached&quot;
              }
          },
          &quot;rabbitmq&quot;: {
              &quot;driver&quot;: &quot;system_service&quot;,
              &quot;args&quot;: {
                  &quot;service_name&quot;: &quot;rabbitmq&quot;,
                  &quot;grep&quot;: &quot;rabbitmq&quot;
              }
          }
      },
      &quot;power_managements&quot;: [
          {
              &quot;driver&quot;: &quot;libvirt&quot;,
              &quot;args&quot;: {
                  &quot;connection_uri&quot;: &quot;qemu+unix:///system&quot;
              }
          }
      ]
  }
  </code></pre>
  <p>The {my_ip}, {my_2nd_ip} and {my_username} will be converted to real value.
  I check the validity of this file with JSON schema validator (the link of the site: <a href="https://www.jsonschemavalidator.net/" rel="nofollow noreferrer">https://www.jsonschemavalidator.net/</a>), and it says 'No Error found. JSON validates against the schema'.
  However, when I run the program I got this error like this.</p>
  <pre><code>Traceback (most recent call last):
    File &quot;kill_service.py&quot;, line 18, in &lt;module&gt;
      main()
    File &quot;kill_service.py&quot;, line 8, in main
      cloud_management = os_faults.connect(cloud_config = 'os-fault.json')
    File &quot;/usr/local/lib/python3.8/dist-packages/os_faults/__init__.py&quot;, line 147, in connect
      jsonschema.validate(cloud_config, CONFIG_SCHEMA)
    File &quot;/usr/lib/python3/dist-packages/jsonschema/validators.py&quot;, line 934, in validate
      raise error
  jsonschema.exceptions.ValidationError: 'os-fault.json' is not of type 'object'
  
  Failed validating 'type' in schema:
      {'$schema': 'http://json-schema.org/draft-04/schema#',
       'properties': {'cloud_management': {'additionalProperties': False,
                                           'properties': {'args': {'type': 'object'},
                                                          'driver': {'type': 'string'}},
                                           'required': ['driver'],
                                           'type': 'object'},
                      'node_discover': {'additionalProperties': False,
                                        'properties': {'args': {},
                                                       'driver': {'type': 'string'}},
                                        'required': ['driver', 'args'],
                                        'type': 'object'},
                      'power_managements': {'items': {'additionalProperties': False,
                                                      'properties': {'args': {'type': 'object'},
                                                                     'driver': {'type': 'string'}},
                                                      'required': ['driver',
                                                                   'args'],
                                                      'type': 'object'},
                                            'minItems': 1,
                                            'type': 'array'},
                      'services': {'additionalProperties': False,
                                   'patternProperties': {'.*': {'additionalProperties': False,
                                                                'properties': {'args': {'type': 'object'},
                                                                               'driver': {'type': 'string'},
                                                                               'hosts': {'items': {'type': 'string'},
                                                                                         'minItems': 1,
                                                                                         'type': 'array'}},
                                                                'required': ['driver',
                                                                             'args'],
                                                                'type': 'object'}},
                                   'type': 'object'}},
       'required': ['cloud_management'],
       'type': 'object'}
  
  On instance:
      'os-fault.json'
  </code></pre>
  <p>My JSON file name is 'os-fault.json'.
  When the program checks the validity of JSON file with</p>
  <blockquote>
  <p>jsonschema.validate(cloud_config, CONFIG_SCHEMA),</p>
  </blockquote>
  <p>it detect some errors in my JSON file. But I can't find out any error in that file.</p>
  <p>Thanks for your help.</p>