Fix json on nested types
Merge pull request #42 from trask/fix-json-nested-types

Fix generated json for nested types
(leftover finally fixed)