def generate(path, name)
      object = get_object(path)

      type = object[TYPE_KEY]
      if type == OBJECT_TYPE
        generate_object(path, name)

      elsif type == ARRAY_TYPE
        generate_top_level_array(path)

      elsif type.is_a?(Array)
        if type.include?(OBJECT_TYPE)
          raise UnsupportedSchemaError if type.include?(ARRAY_TYPE)
          generate_object(path, name)

        elsif type.include?(ARRAY_TYPE)
          generate_top_leve_array(path)

        else raise UnsupportedSchemaError; end
      else raise UnsupportedSchemaError; end
    end
def generate(path, name)
      object = get_object(path)

      type = object[TYPE_KEY]
      if type == OBJECT_TYPE
        generate_object(path, name)

      elsif type == ARRAY_TYPE
        generate_top_level_array(path)

      elsif type.is_a?(Array)
        if type.include?(OBJECT_TYPE)
          raise UnsupportedSchemaError if type.include?(ARRAY_TYPE)
          generate_object(path, name)

        elsif type.include?(ARRAY_TYPE)
          generate_top_leve_array(path)

        else raise UnsupportedSchemaError; end
      else raise UnsupportedSchemaError; end
    end
Generates a Model and adds it to the models array.
 @param path [Array] the path to an object in the schema
 @param name [String] raw model name