Fix generated json for nested types