I just find out the hard way that JSON is case sensitive which means that lWeekRecord['TT_WK_ID'] is not the same as lWeekRecord['tt_wk_id'] (lWeekRecord is an ISuperObject).
I cannot find anything about case sensitivity in the limited SuperObject documentation.
Has anyone ever found/fixed/hacked this; and can tell me how to do that?
I prefer my webservice that receives JSON data to be insensitive to JSON name case.
Edited:
I only need to consume JSON generated by another system, and that only talks to me. I want to be lenient towards the developers of that system. Their JSON is serialized C objects, and I really don't care if they call their vars foo or Foo. Actually, it's worse: parts of their objects are derived from database field names supplied to them, and these even come from different RDBMSes. So this is a chain of dependencies with multiple players involved that can break on something silly as case sensitivity.
If I can avoid that for those people, I want to.
No one in their right mind in that chain is going to use both foo and Foo together (and that would not even be possible in mosts RDMBSes), so I don't have to guard against that.
This isn't really a SuperObject issue. Rather this is a property of JSON itself, which use case-sensitive comparisons.
If you really want to allow your service to be insensitive to letter case, then you'll need to implement the key lookup yourself. Instead of looking up a named value in an object, iterate over all the name/value pairs and perform whatever comparison you wish to do. In pseudo-code it would be something like this:
I would strongly urge you not to do this though. JSON is case sensitive. That's how it is designed and you will find life easier if you go with the flow. Swimming against the tide in this way will surely lead to all sorts of trouble later.