opscode/chef — pull request #1017 by seth (2013-09-30 23:42:46+00:00)
Title: Prevent duplicate keys in cookbook version JSON

Reported in CHEF-4571. The recipes component of cookbook version
metadata (cbv.metadata.recipes) serialized to JSON with duplicate keys
if a metadata.rb was present that provided a recipe line matching the
cookbook name (providing a description for the default recipe).

The root cause is the behavior of the JSON serialized when called on a
hash containing matching string and symbol keys. For example:

chef > {"key1" => "sam", :key1 => "wat"}.to_json
=> "{\"key1\":\"sam\",\"key1\":\"wat\"}"

So the specific fix is to prevent inserting a symbol key for the
recipe name.