title: Formik & Yup - How to make a schema for an array and string
body: <p>I am using <code>Formik</code> to create a form of a book library where each item in the list would look like: </p>
  
  <pre><code>author: {
   name: 'string',
   titles: ['string']
  }
  </code></pre>
  
  <p>I am having trouble trying to make a schema with <code>Yup</code> to validate those fields. I have:</p>
  
  <pre><code>schema = Yup.object().shape({
   author: Yup.object().shape({
    name: Yup.string().min().max().required('...')
   }),
   author: Yup.array().of(
    Yup.object().shape({
     titles: Yup.string().min().max().required('...')
    })
   )
  });
  </code></pre>
  
  <p>The initial values are also:</p>
  
  <pre><code>{
   author: {name: ''},
   author: [{ titles: '' }]
  }
  </code></pre>
  
  <p>My validation works for the array but not the name. I am assuming the issue is that I cannot have the same name for both of the elements in the object, however I do not know how to combine the two fields in both the initial values as well as the schema. I looked through Yup API and I noticed they had <code>mixed()</code> but I didn't understand how to implement with what I need. Is this way possible or would having validation for both of these possible?</p>