docs: def json_schema_type(schema_file: str, **kwargs) -> typing.Type:
      """Create a :class:`~doctor.types.JsonSchema` type.
  
      This function will automatically load the schema and set it as an attribute
      of the class along with the description and example.
  
      :param schema_file: The full path to the json schema file to load.
      :param kwargs: Can include any attribute defined in
          :class:`~doctor.types.JsonSchema`
      """
      # Importing here to avoid circular dependencies
      from doctor.resource import ResourceSchema
      schema = ResourceSchema.from_file(schema_file)
      kwargs['schema'] = schema
  
      # Look up the description, example and type in the schema.
      definition_key = kwargs.get('definition_key')
      if definition_key:
          params = [definition_key]
          request_schema = schema._create_request_schema(params, params)
          try:
              definition = request_schema['definitions'][definition_key]
          except KeyError:
              raise TypeSystemError(
                  'Definition `{}` is not defined in the schema.'.format(
                      definition_key))
          description = get_value_from_schema(
              schema, definition, 'description', definition_key)
          example = get_value_from_schema(
              schema, definition, 'example', definition_key)
          json_type = get_value_from_schema(
              schema, definition, 'type', definition_key)
          json_type, native_type = get_types(json_type)
          kwargs['description'] = description
          kwargs['example'] = example
          kwargs['json_type'] = json_type
          kwargs['native_type'] = native_type
      else:
          try:
              kwargs['description'] = schema.schema['description']
          except KeyError:
              raise TypeSystemError('Schema is missing a description.')
          try:
              json_type = schema.schema['type']
          except KeyError:
              raise TypeSystemError('Schema is missing a type.')
          json_type, native_type = get_types(json_type)
          kwargs['json_type'] = json_type
          kwargs['native_type'] = native_type
          try:
              kwargs['example'] = schema.schema['example']
          except KeyError:
              # Attempt to load from properties, if defined.
              if schema.schema.get('properties'):
                  example = {}
                  for prop, definition in schema.schema['properties'].items():
                      example[prop] = get_value_from_schema(
                          schema, definition, 'example', 'root')
                  kwargs['example'] = example
              else:
                  raise TypeSystemError('Schema is missing an example.')
  
      return type('JsonSchema', (JsonSchema,), kwargs)