hoxworth/json-schema — pull request #142 by iainbeeston (2014-10-26 11:27:35+00:00)
Title: Replaced #add_indifferent_access with #stringify

This is a fix for #96

Previously, add_indifferent_access would modify the data and schema hashes in place, to make them accept strings or hashes as keys. However, there are two problems with this:

1. It works for accessing the hash (eg. fetch or []) but it does not work if we use .has_key? or .keys
2. It does not convert arrays of symbols into arrays of strings (which can be a problem when the symbols in the array refer to attributes, eg. required)

To resolve this, I've removed add_indifferent_access in favour of stringify, which returns a new copy of the hash, with all symbols converted to strings. This is probably a better approximation of json anyway, but it also makes accessing values from the hash easier, because we always know that we'll be dealing with strings (not symbols).