title: Create a pydantic model with dynamic keys
body: <p>I want to create a Pydantic model for this structure:</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;key-1&quot;: [&quot;value-1&quot;, &quot;value-2&quot;],
    &quot;key-2&quot;: [&quot;value-3&quot;],
    &quot;key-3&quot;: []
  }
  </code></pre>
  <p>My first attempt was</p>
  <pre><code>class MyModel(BaseModel):
    __root__ = Dict[str, List[str]]
  
    @root_validator(pre=True)
    def validate_all_the_things(cls, values):
      # check if keys and values match some regexes
  </code></pre>
  <p>But this raises an exception:</p>
  <pre><code>RuntimeError: no validator found for &lt;class 'typing._GenericAlias'&gt;, see `arbitrary_types_allowed` in Config
  </code></pre>
  <p>If i change <code>Dict</code> to <code>dict</code>, i don’t get the exception, but the resulting object yields an empty dict:</p>
  <pre><code>&gt;&gt;&gt; MyModel(**{&quot;key-1&quot;: [&quot;value-1&quot;]}).dict()
  {}
  </code></pre>
  <p>what am i doing wrong?</p>