Generated dependent fields if they are of a union type.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
Merge pull request #196 from ddobrev/master

Generated dependent fields if they are of a union type