Iterate using Object.keys to avoid validating on nonexistent attributes.