title: Is there a way to have an array of objects with some of them literals?
body: <p>I'm thinking about the following validation with zod and I have no clue on how to do it (or if it's possible with zod).
  I want an array of objects, all with the same shape, with some of them with literal props, I need these always present in the array.</p>
  <p>Example:
  I need always in the array the objects those with name required1 and required2, and then other objects optionals following the same shape.</p>
  <pre class="lang-js prettyprint-override"><code>[
      {
        name: z.literal('required1'),
        otherprop: z.number()
      },
      {
        name: z.literal('required2'),
        otherprop: z.number()
      },
      // I want to include one or more of the following too (optionals).
      {
        name: z.string(),
        otherprop: z.number()
      },
  ]
  </code></pre>
  <p>This other example needs to throw because required2 is missing</p>
  <pre class="lang-js prettyprint-override"><code>[
      {
        name: z.literal('required1'),
        otherprop: z.number()
      },
      // I want to include one or more of the following too.
      {
        name: z.string(),
        otherprop: z.number()
      },
  ]
  </code></pre>
  <p>Any clue?</p>