title: How to define Pydantic Class for nested dictionary
body: <p>How do we define a Pydantic Class Type for the following nested dictionary structure (with complicated strings as keys):</p>
  <pre class="lang-py prettyprint-override"><code>{ &quot;inputs&quot; : {
          &quot;simpleStringName&quot;: &lt;Simple_DateTime_Value&gt;
          &quot;simpleStringName2&quot;: {
          &quot;Complicated|String|Name|with|Pipe|Characters&quot; : &lt;Simple-Int-Value&gt;,
          &quot;Complicated|String|Name2|with|Pipe|Characters&quot; : &lt;Simple-Int-Value2&gt;
          }
      }
  }
  </code></pre>
  <p>Pydantic needs to enforce the entire structure. That is simply this will not work:</p>
  <pre class="lang-py prettyprint-override"><code>class XYZ(BaseModel):
      inputs : Dict()
  </code></pre>
  <p>I want to enforce requests input format using Pydantic with fastAPI.</p>