title: How do i write zod schema for a deeply nested object
body: <p>I have the following data:</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;2022-06-01&quot;: {
      &quot;09:00am&quot;: {
        &quot;time_table_id&quot;: 1,
        &quot;job_id&quot;: 4,
        &quot;start_working_time&quot;: &quot;09:00am&quot;,
        &quot;end_working_time&quot;: &quot;09:00pm&quot;,
        &quot;work_duration&quot;: &quot;12:00:00&quot;,
        &quot;merchant_name&quot;: &quot;Brands Outlet @ The Starling&quot;,
        &quot;address2&quot;: &quot;Jalan SS 21/37, Damansara Utama&quot;,
        &quot;job_name&quot;: &quot;Pro hero&quot;,
        &quot;job_application_status&quot;: &quot;Hired&quot;
      }
    }
  }
  </code></pre>
  <p>and this is my schema but it is giving me a zod error.</p>
  <pre class="lang-js prettyprint-override"><code>const apiScheme = z.object({
    Date: z.object({
      Time: z.object({
        date: z.string(),
        time_table_id: z.number().nullable(),
        job_id: z.number(),
        start_working_time: z.string(),
        end_working_time: z.string(),
        // work_duration: z.string(),
        // merchant_name: z.string(),
        // address2: z.string(),
        job_name: z.string(),
        job_application_status: z.string(),
      }),
    }),
  });
  
  // -- snip -- (React code):
  
  const data = useMemo(() =&gt; {
    if (responseData) {
      const parseData = apiScheme.parse(responseData);
      //    error here ~~~~~~~~~~-^
      if (parseData) {
        return parseData;
      }
    }
    return null;
  }, [responseData]);
  </code></pre>