Updated expectedFields to read both optional and required.