add nested objects to encoder
generator tests