Don't assume typeKey is always camelized.

This is a followup of  #1652 but adding test.