    # File lib/chef/role.rb, line 163
        def to_hash
          env_run_lists_without_default = @env_run_lists.dup
          env_run_lists_without_default.delete("_default")
          result = {
            "name" => @name,
            "description" => @description,
            'json_class' => self.class.name,
            "default_attributes" => @default_attributes,
            "override_attributes" => @override_attributes,
            "chef_type" => "role",

            #Render to_json correctly for run_list items (both run_list and evn_run_lists)
            #so malformed json does not result
            "run_list" => run_list.run_list.map { |item| item.to_s },
            "env_run_lists" => env_run_lists_without_default.inject({}) do |accumulator, (k, v)|
              accumulator[k] = v.map { |x| x.to_s }
              accumulator
            end
          }
          result["_rev"] = couchdb_rev if couchdb_rev
          result
        end